-
Notifications
You must be signed in to change notification settings - Fork 0
Comments
Conversation
src/main/java/Main.java
Outdated
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.
можно заменить с помощью конструкции switch case, для улучшения читаемости кода
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.
Много лишних пустых строк, стоит придерживаться порядка в файлах и код стайла
src/main/java/Main.java
Outdated
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.
не корректная логика, необходимо проверять последние цифры у чисел, а в твоем случае функция Math.floor() вернет просто целое число, без знаков после запятой. Например Math.floor(51,23) вернет 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.
стоит поправить форматирование, в частности отступы для этого можно использовать хоткей ctrl+alt+L
src/main/java/Menu.java
Outdated
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.
В данном случае приложение упадет, если пользователь введет не число. Можно исправить с помощью конструкции try catch, либо с помощью проверки scan.hasNextDouble()
src/main/java/Menu.java
Outdated
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.
можно использовать укороченную запись allproduct += product + "\n"
src/main/java/Menu.java
Outdated
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.
в данном случае, пользователь может снова ввести число меньше нуля и программа его примет
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.
приложение упадет, если будет не число
No description provided.