total price for each element

This commit is contained in:
bronku 2025-04-06 11:38:56 +02:00
parent 8fddf65e5a
commit 9649bb157c
2 changed files with 9 additions and 4 deletions

View file

@ -31,3 +31,7 @@ func (o *Order) Total() int {
}
return out
}
func (c *Cake) Total() int {
return c.Amount * c.Price
}