-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lab7 #625
base: Moshkova_Elizaveta
Are you sure you want to change the base?
lab7 #625
Conversation
) | ||
|
||
func main() { | ||
fmt.Println("Мошкова Елизавета Алексеевна ") | ||
lab6.RunLab6() | ||
lab4.RunLab4() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лишнее
type Product interface { | ||
GetInfo() | ||
GetPrice() float64 | ||
SetDiscount(float64) | ||
EditPrice(float64) | ||
EditDescription(string) | ||
} | ||
|
||
func CalculatePrice(purchase []Product) float64 { | ||
var total float64 = 0 | ||
for _, price := range purchase { | ||
total += price.GetPrice() | ||
} | ||
return total | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
отдельный файл с продуктом
var drink Product = &Drink{"кола", "1.95 л", 160} | ||
var toy Product = &Toy{"котик", "25 см", 1650} | ||
var lipstick Product = &Lipstick{"NARS", "бардовая", 4700} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не должны быть продукты изначально
(*d).Price = x | ||
} | ||
|
||
func (d *Drink) EditDescription(x string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не правильное название функции или должно быть поле описание
} | ||
|
||
func (l *Lipstick) EditDescription(x string) { | ||
(*l).Color = x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это не description
} | ||
|
||
func (t *Toy) EditDescription(x string) { | ||
(*t).Size = x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это не description
No description provided.