Skip to content

Первый ПР для первого задания#1

Open
vladsharipov wants to merge 7 commits into
mainfrom
master
Open

Первый ПР для первого задания#1
vladsharipov wants to merge 7 commits into
mainfrom
master

Conversation

@vladsharipov

Copy link
Copy Markdown
Owner

Мои коммиты с 23.11. Сам вносил изменения только в классы Main и Goods. Спасибо за вашу работу.

Comment thread src/main/java/Main.java
System.out.println("Упс! Для верного расчёта количество человек должно быть больше 1. Попробуйте ещё раз:");
}
catch (NumberFormatException exception) {
System.out.println("Нужно ввести целое число больше 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.

Имеет смысл выносить такие большие логические фрагменты в отдельные методы и вызывать их там, где необходимо. Это делает программу более удобочитаемой, когда разнородная логика не смешивается в один сплошной код.

Comment thread src/main/java/Goods.java
}
}
goodList.append(name + "\n");
priceSum = priceSum + 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.

Также можно использовать сокращенную конструкцию priceSum += 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