Skip to content
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

Baldina Lab7 #445

Open
wants to merge 5 commits into
base: Baldina_Daria
Choose a base branch
from
Open

Conversation

BaldinaDaria
Copy link

No description provided.

Comment on lines 14 to 36
type Item struct {
Name string
Price float64
}

func (i *Item) GetName() string {
return i.Name
}

func (i *Item) GetPrice() float64 {
return i.Price
}

func (i *Item) SetPrice(price float64) {
i.Price = price
}

func (i *Item) ApplyDiscount(discount float64) {
i.Price -= discount
if i.Price < 0 {
i.Price = 0
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Нужно создать структуры конкретные, а не абстрактные. Создайте структуры Утюг, Микроволновка и Холодильник в отдельных файла и используйте здесь

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