-
Notifications
You must be signed in to change notification settings - Fork 222
Евгений Ким. Консольное приложение №1 v1.0 #105
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: master
Are you sure you want to change the base?
Conversation
src/main/java/Main.java
Outdated
| Scanner scanner = new Scanner(System.in); | ||
| scanner.useLocale(Locale.US); | ||
|
|
||
| int peopleNumber = 0; |
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.
Можно не задавать начальное нулевое значение, так как затем всё равно происходит присваивание через scanner.nextInt();
|
|
||
| System.out.println("Хотите добавить еще товар? Чтобы завершить, введите \'Завершить\'"); | ||
| contunieGoodAdding = scanner.next(); | ||
| if (contunieGoodAdding.equalsIgnoreCase("Завершить")) { |
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.
можно сделать из этого цикла while цикл do-while и вынести это условие в while()
src/main/java/GoodCalculator.java
Outdated
| return "рубля"; | ||
|
|
||
| default: | ||
| return "рублей"; |
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.
не хватает ключевого слова break для работы конструкции switch-case
| String goodName = ""; | ||
| double goodPrice; | ||
| double goodSumPrice = 0.0; | ||
| } |
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 v1.0