Евгений Ким. Консольное приложение №1 v1.0#105
Open
byBlinque wants to merge 2 commits intoYandex-Practicum:masterfrom
Open
Евгений Ким. Консольное приложение №1 v1.0#105byBlinque wants to merge 2 commits intoYandex-Practicum:masterfrom
byBlinque wants to merge 2 commits intoYandex-Practicum:masterfrom
Conversation
faritowich
reviewed
Oct 30, 2022
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.
Можно не задавать начальное нулевое значение, так как затем всё равно происходит присваивание через scanner.nextInt();
|
|
||
| System.out.println("Хотите добавить еще товар? Чтобы завершить, введите \'Завершить\'"); | ||
| contunieGoodAdding = scanner.next(); | ||
| if (contunieGoodAdding.equalsIgnoreCase("Завершить")) { |
There was a problem hiding this comment.
можно сделать из этого цикла while цикл do-while и вынести это условие в while()
src/main/java/GoodCalculator.java
Outdated
| return "рубля"; | ||
|
|
||
| default: | ||
| return "рублей"; |
There was a problem hiding this comment.
не хватает ключевого слова break для работы конструкции switch-case
| String goodName = ""; | ||
| double goodPrice; | ||
| double goodSumPrice = 0.0; | ||
| } |
There was a problem hiding this comment.
Конструктор не используется. Его можно убрать.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Евгений Ким. Консольное приложение №1 v1.0