-
Notifications
You must be signed in to change notification settings - Fork 0
Консольного приложение (разделить счет) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/main/java/Calculation.java
Outdated
| System.out.println("Итого: " + String.format("%.2f", result) + " " + rubl + ";\nС каждого по: " + String.format("%.2f", resultPerPerson) + " " + rubl1 + "."); | ||
| } | ||
|
|
||
| String chooseTheCorrectCase(double x) { // метод для определения правильного падежа слова "рубль" |
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/Nomenclature.java
Outdated
| String name; | ||
| double price; | ||
|
|
||
| public String checkName(String x) { |
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/Nomenclature.java
Outdated
| public String checkName(String x) { | ||
| while (true) { | ||
| Scanner scanner = new Scanner(System.in); | ||
| x = scanner.nextLine(); |
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/Nomenclature.java
Outdated
| Scanner scanner = new Scanner(System.in); | ||
| if (!scanner.hasNextDouble()) System.out.println("Ошибка ввода. Введите цену товара в формате \"рубли,копейки\""); // если ввод текста вместо числа или "." вместо "," | ||
| else { | ||
| x = scanner.nextDouble(); |
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 попытка сдачи консольного приложения