diff --git a/golang/labs/lab7/vegetables.go b/golang/labs/lab7/vegetables.go index 5ee81874..80efd300 100644 --- a/golang/labs/lab7/vegetables.go +++ b/golang/labs/lab7/vegetables.go @@ -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) }