Skip to content

Commit

Permalink
Update vegetables.go
Browse files Browse the repository at this point in the history
  • Loading branch information
dusyaT authored Dec 18, 2024
1 parent d3b2ea8 commit ab3c0c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion golang/labs/lab7/vegetables.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ type Vegetables struct {
func (c *Vegetables) make_sale(discount float64) {
c.Price = c.Price * (1 - discount/100)
}

func (c *Vegetables) get_price() float64 {
return c.Price
}

func (c *Vegetables) get_productInfo() string {
return fmt.Sprintf("Name: %s, Weight %s, Price: %.2f", c.Name, c.Weight, c.Price)
return fmt.Sprintf("Name: %s, Weight: %.2f, Price: %.2f", c.Name, c.Weight, c.Price)
}

0 comments on commit ab3c0c1

Please sign in to comment.