-
Notifications
You must be signed in to change notification settings - Fork 220
Comments
Pull request к приложению «Калькулятор счёта»#102
Pull request к приложению «Калькулятор счёта» #102Ilya-97 wants to merge 2 commits intoYandex-Practicum:master from
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь лучше прописать money % 10 == 1, чтобы попадало 21, 51 и т.д.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выражение money % 10 считается несколько раз, можно посчитать его один раз, записать в переменную и использовать ее
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Код System.out.println("Сумма, которую должен заплатить каждый человек составляет: " + str + " рублей"); повторяется в каждой ветке, кроме слова рубль, лучше код вынести после if-else, оставив в нем только определение слова
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно текст "Пожалуйста, введите значение больше 1." записать в константу, он повторяется 3 раза
Добавил обработку на вопрос про количество человек и стоимость с помощью методов scanner.hasNextInt() и hasNextFloat()