Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added initial functionality#1

Open
GazarovaPolina wants to merge 1 commit intomaster from
feature/initial-functionality
Open

Added initial functionality #1
GazarovaPolina wants to merge 1 commit intomaster from
feature/initial-functionality

Conversation

@GazarovaPolina
Copy link
Owner

@GazarovaPolina GazarovaPolina commented Nov 29, 2022

No description provided.


while (true) {

System.out.println("Введите любой символ для продолжения добавления товаров или \"завершить\":");
Copy link

@MagicUnderHood MagicUnderHood Dec 1, 2022

Choose a reason for hiding this comment

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

Можно эту часть с выходом переместить после ввода товара

System.out.println("Введите название товара:");
productName = scanner.nextLine();

System.out.println("Введите его стоимость:");
Copy link

@MagicUnderHood MagicUnderHood Dec 1, 2022

Choose a reason for hiding this comment

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

Можно дописать формат, в котором ожидается стоимость

if (productPrice <= 0) {
return false;
}
return true;
Copy link

@MagicUnderHood MagicUnderHood Dec 1, 2022

Choose a reason for hiding this comment

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

Студия подсказывает, что вместе с if-ом выше можно преобразовать в код: return !(productPrice <= 0);

payment += product.getPrice();
}
payment /= friendsAmount;
int lastDigit = (int) Math.floor(payment) % 10;
Copy link

@MagicUnderHood MagicUnderHood Dec 1, 2022

Choose a reason for hiding this comment

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

Единственное, не учтено для чисел 11-19, окончание должно быть "рублей", а сейчас дает рубля для 12-14. Для этого стоит проверять, что (int) Math.floor(payment) % 100 между 11 и 19 включительно находится

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@MagicUnderHood MagicUnderHood MagicUnderHood left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Comments

AltStyle によって変換されたページ (->オリジナル) /