Skip to content

Pull Request - 1 #1

Open
Ahilesov wants to merge 3 commits intomainfrom
dev
Open

Pull Request - 1 #1
Ahilesov wants to merge 3 commits intomainfrom
dev

Conversation

@Ahilesov
Copy link
Copy Markdown
Owner

@Ahilesov Ahilesov commented Mar 7, 2023

No description provided.

public String getProductName() {

while (true) {
if (!sc.hasNextInt()) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошее дополнение исключать числовые значения, как название товара 👍

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Благодарю за похвалу!!!

Comment on lines +9 to +19
public double getPriceProduct() {
while (true) {
if (sc.hasNextDouble()) {
priceProduct = sc.nextDouble();
return priceProduct;
} else {
System.out.println("Введено не корректное значение стоимости.Повторите ввод.");
}
sc.nextLine();
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ Лучше еще дополнительно добавить проверку ввода некорректного значения, что стоимость товара не может быть отрицательной

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил!

добавил проверку отрицательной и нулевой стоимости товара
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants