Skip to content

lab7#625

Open
Lizoooooookkk wants to merge 2 commits intoISUCT:Moshkova_Elizavetafrom
Lizoooooookkk:lab7
Open

lab7#625
Lizoooooookkk wants to merge 2 commits intoISUCT:Moshkova_Elizavetafrom
Lizoooooookkk:lab7

Conversation

@Lizoooooookkk
Copy link
Copy Markdown

No description provided.

Comment thread golang/main.go
func main() {
fmt.Println("Мошкова Елизавета Алексеевна ")
lab6.RunLab6()
lab4.RunLab4()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишнее

Comment thread golang/lab7/lab7.go
Comment on lines +7 to +21
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
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отдельный файл с продуктом

Comment thread golang/lab7/lab7.go
Comment on lines +24 to +26
var drink Product = &Drink{"кола", "1.95 л", 160}
var toy Product = &Toy{"котик", "25 см", 1650}
var lipstick Product = &Lipstick{"NARS", "бардовая", 4700}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не должны быть продукты изначально

Comment thread golang/lab7/Drink.go
(*d).Price = x
}

func (d *Drink) EditDescription(x string) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не правильное название функции или должно быть поле описание

Comment thread golang/lab7/Lipstick.go
}

func (l *Lipstick) EditDescription(x string) {
(*l).Color = x
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это не description

Comment thread golang/lab7/Toy.go
}

func (t *Toy) EditDescription(x string) {
(*t).Size = x
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это не description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants