Skip to content

1#1

Open
Venera-sav wants to merge 4 commits intomainfrom
master
Open

1#1
Venera-sav wants to merge 4 commits intomainfrom
master

Conversation

@Venera-sav
Copy link
Copy Markdown
Owner

No description provided.

if (count < 1)
System.out.println("Количество гостей должно быть больше 1 человека. Попробуем еще раз? )");
else {
if (count == 1) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

count < 1 и count < 1 можно объединить в count <= 1, без лишней вложенности

else if (count%10>1 && count%10<5) {
form = "рубля";
}
else form = "рублей";
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-else if-else можно заменить на switch-case

System.out.println("Введите товар");
String product = console.nextLine();
float price = priceChecking();
sum=sum+price;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно использовать сокращенную конструкцию sum += price;

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