Skip to content

Проектная работа №1 alexgolyud - #56

Open
agolyud wants to merge 16 commits into
Yandex-Practicum:masterfrom
agolyud:master
Open

agolyud wants to merge 16 commits into
Yandex-Practicum:masterfrom
agolyud:master

Conversation

@agolyud

@agolyud agolyud commented Sep 30, 2022

Copy link
Copy Markdown

Проектная работа №1 alexgolyud

Comment thread src/main/java/Main.java Outdated
case 4:
endingRuble = "рубля";
default:
endingRuble = "рублей";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Сейчас вне зависимости от кейсов будет возвращаться default, потому что нет ключевого слова break в конце кейсов, например:

endingRuble = "рубль";
break;

Также сейчас нет обработки для чисел, содержащих 11,12,13,14. Сейчас вывод будет 11 рубль, 12 рубля и т.д. То же самое касается 111, 112 рублей. Стоит обработать такие случаи тоже.

Comment thread src/main/java/Main.java Outdated
String nextPosition = in.next();
out.println("Введите стоимость в формате: 'рубли.копейки' [10,45, 11,40]");
double nextPrice = in.nextDouble();
int i = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В данном случае можно не создавать лишнюю переменную-счетчик, а использовать размер списка items.size()

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.

3 participants