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

CProject#34

Open
KTDem wants to merge 4 commits intoYandex-Practicum:master from
KTDem:master
Open

CProject #34
KTDem wants to merge 4 commits intoYandex-Practicum:master from
KTDem:master

Conversation

@KTDem
Copy link

@KTDem KTDem commented Sep 12, 2022

Calculator

System.out.println("Ошибка, введите корректное число.");
}
while (true) {
double i = scanner.nextDouble();
Copy link

@MagicUnderHood MagicUnderHood Sep 13, 2022

Choose a reason for hiding this comment

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

Лучше называть переменные так, чтобы при взгляде на них было сразу понятно, что они означают. Например, тут использовать имя price

break;
}
}
System.out.println("Успех! \nХотите ли добавить еще продукт?");
Copy link

@MagicUnderHood MagicUnderHood Sep 13, 2022

Choose a reason for hiding this comment

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

Тут лучше дописать "Введи Завершить, чтобы закончить ввод", иначе пользователь не поймёт, что следует ввести для выхода

double result = summary / guests;
String rubleTitle = rubleCase(result);
System.out.println(dishes);
System.out.println(String.format("%.2f", result) + " " + rubleTitle);
Copy link

@MagicUnderHood MagicUnderHood Sep 13, 2022

Choose a reason for hiding this comment

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

Можно добавить больше информации в вывод, например "Каждый человек должен заплатить ..."

return "рубля";
}
else {
return "рублей ";
Copy link

@MagicUnderHood MagicUnderHood Sep 13, 2022

Choose a reason for hiding this comment

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

Этот if-else можно переписать на switch

// ваш код начнется здесь
// вы не должны ограничиваться только классом Main и можете создавать свои классы по необходимости
System.out.println("Привет Мир");
int i;
Copy link

@MagicUnderHood MagicUnderHood Sep 13, 2022

Choose a reason for hiding this comment

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

Лучше называть переменные так, чтобы при взгляде на них было сразу понятно, что они означают. Например, тут использовать имя person

System.out.println("Введите корректное количество гостей.");
}

if (i > 1) {
Copy link

@MagicUnderHood MagicUnderHood Sep 13, 2022

Choose a reason for hiding this comment

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

Это условие можно перенести в виде else к предыдущему if

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 left review comments

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 によって変換されたページ (->オリジナル) /