Skip to content

First homework - #1

Open
Testbek wants to merge 2 commits into
mainfrom
first-homework
Open

First homework#1
Testbek wants to merge 2 commits into
mainfrom
first-homework

Conversation

@Testbek

@Testbek Testbek commented Jan 25, 2025

Copy link
Copy Markdown
Owner

Have 2.20 want 2.27

@dirtymew dirtymew left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Привет Вячеслав

хорошая работа - тесты проходят

зачет

Comment thread ftracker.go
// ваш код здесь
...
// ваш код здесь
return ((18 * meanSpeed(action, duration) * runningCaloriesMeanSpeedShift) * weight / mInKm * duration * minInH)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

нужно константу было использовать runningCaloriesMeanSpeedMultiplier

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Спасибо, в следующий раз буду повнимательней.

Comment thread ftracker.go
// ваш код здесь
...
// ваш код здесь
return (walkingCaloriesWeightMultiplier*weight + (math.Pow(meanSpeed(action, duration)*kmhInMsec, 2)/(height/cmInM))*walkingSpeedHeightMultiplier*weight) * duration * minInH

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

тут возможно деление на 0 если height == 0

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

тут возможно деление на 0 если height == 0

Как правильно было бы сделать проверку на 0, не используя дополнительные строчки кода, если это возможно?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

а кто запретил код писать?

в данном случае можно вот так просто

if height == 0 {
 		return 0
 	}

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