-
Notifications
You must be signed in to change notification settings - Fork 220
Comments
Conversation
# Conflicts: # src/main/java/Main.java
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.
Можешь применить в студии автоформатирование (в выбранном файле, сверху вкладка Code - Reformat Code, либо Ctrl+Alt+L), тогда автоматически код выправится
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.
Студия подсказывает, что возвращаемый тип функции никак не используется, тогда можно его убрать, или всё-таки использовать. Методы лучше называть с глаголом, например, readPeople или getPeople (это если возвращаемый результат будет использоваться)
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.
Класс содержит информацию не о продукте, а обо всех продуктах, так что можно назвать его Menu или хотя бы Products
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.
Поскольку в этой переменной хранится не имя одного продукта, а все продукты, лучше ее назвать productNames
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.
Аналогично с nameProduct
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.
Здесь нужен просто scan.next();, иначе приложение упадет, поскольку мы проверили, что !scan.hasNextInt()
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.round(productPrice) и Math.round(productPrice)%10, Math.round(productPrice)%100 можно вынести в переменные
Привет, это моя проектная работаNo1