Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Практическая работа No1#1

Open
TelenkovAleksey wants to merge 6 commits intomain from
master
Open

Практическая работа No1 #1
TelenkovAleksey wants to merge 6 commits intomain from
master

Conversation

@TelenkovAleksey
Copy link
Owner

@TelenkovAleksey TelenkovAleksey commented Sep 12, 2022

No description provided.

Copy link
Owner Author

@TelenkovAleksey TelenkovAleksey left a comment

Choose a reason for hiding this comment

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

Внес изменения

Copy link
Owner Author

@TelenkovAleksey TelenkovAleksey left a comment

Choose a reason for hiding this comment

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

Внес изменения.


} else {
System.out.println("Введите стоимость продукта в формате \"'рубли.копейки' [10.45, 11.40]\"");
float inputPrice = (float) scanner.nextDouble();

This comment was marked as resolved.


price = price + inputPrice;

System.out.println("Вы успешно добавили продукт:" + food + "\nИтог: " + String.format("%.2f", price) + " " + Matsh.floover(itog));
Copy link

@MagicUnderHood MagicUnderHood Sep 14, 2022

Choose a reason for hiding this comment

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

Здесь выводится стоимость товара - price, но расчет окончания слова Рубль берется для числа itog, а должна быть одна и та же переменная

Copy link

@MagicUnderHood MagicUnderHood Sep 15, 2022

Choose a reason for hiding this comment

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

Наставница передала твой вопрос, что я имела в виду:
У тебя строка:
System.out.println("Вы успешно добавили продукт:" + food + "\nИтог: " + String.format("%.2f", price) + " " + Matsh.floover(itog));
А должно быть:
System.out.println("Вы успешно добавили продукт:" + food + "\nИтог: " + String.format("%.2f", price) + " " + Matsh.floover(price));
То есть просто ты тут выводишь число в виде переменной price, но в метод, выдающий окончание слова рубль передаешь другую переменную, itog. Из-за этого при выводе стоимости продукта окончание не то получалось

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

Reviewers

1 more reviewer

@MagicUnderHood MagicUnderHood MagicUnderHood requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Comments

AltStyle によって変換されたページ (->オリジナル) /