Skip to content

first commit#1

Open
LiebeBleck wants to merge 3 commits intomainfrom
Third
Open

first commit#1
LiebeBleck wants to merge 3 commits intomainfrom
Third

Conversation

@LiebeBleck
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@dirtymew dirtymew left a comment

Choose a reason for hiding this comment

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

Привет

нужно реализовать методы TrainingInfo()

Comment thread main.go
// вставьте ваш код ниже
...
return (s.meanSpeed() + SwimmingCaloriesMeanSpeedShift) *
SwimmingCaloriesWeightMultiplier * s.Weight * s.Duration.Hours()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@LiebeBleck нужно реализовать метод

func (s Swimming) TrainingInfo() InfoMessage {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Для реализации этого метода для структуры Swimming{} нужно полностью переопределить TrainingInfo() с учетом того, как рассчитывается средняя скорость для плавания, дистанция и так далее. Реализация TrainingInfo() для Swimming{} будет похожа на реализацию TrainingInfo() для Training{}, но с иcпользованием методов для Swimming{}.

Comment thread main.go

// TrainingInfo возвращает структуру InfoMessage с информацией о проведенной тренировке.
// Это переопределенный метод TrainingInfo() из Training.
func (w Walking) TrainingInfo() InfoMessage {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@LiebeBleck

Метод TrainingInfo() возвращает переменную структуры InfoMessage{} с информацией о проведённой
тренировке.
Для реализации этого метода для структуры Walking{} нужно вернуть вызов такого же метода TrainingInfo(), только для структуры Training{}. Вспомните, как вызывать методы встроенной структуры.

Comment thread main.go

// TrainingInfo возвращает структуру InfoMessage с информацией о проведенной тренировке.
// Это переопределенный метод TrainingInfo() из Training.
func (r Running) TrainingInfo() InfoMessage {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Метод TrainingInfo() возвращает переменную структуры InfoMessage{} с информацией о проведённой
тренировке.
Для реализации этого метода для структуры Running{} нужно вернуть вызов такого же метода TrainingInfo(), только для структуры Training{}. Вспомните, как вызывать методы встроенной структуры.

Copy link
Copy Markdown

@dirtymew dirtymew left a comment

Choose a reason for hiding this comment

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

Привет

еще метод ReadData нужно доделать

Comment thread main.go
...

return fmt.Sprint(info)
return training.TrainingInfo().String()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

тут нужно поле Calories переопределить - иначе там напечатаются 0 для Walking и Running

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