Skip to content

Первое задание на курсе#1

Open
Heijin wants to merge 4 commits intomainfrom
dev
Open

Первое задание на курсе#1
Heijin wants to merge 4 commits intomainfrom
dev

Conversation

@Heijin
Copy link
Copy Markdown
Owner

@Heijin Heijin commented Apr 20, 2023

Проектная работа №1.
Ткач Евгений.

public class Calculator {

int persons;
Double summ = 0.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.

Double можно просто написать double, как и другие численные значения

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.

Спасибо, не понятно почему я вообще с большой буквы написал.

switch ((int) lastDigit) {

case 1:
return "рубль";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Неверно преобразовывает склонение слова рубль
image
Не думаю, что стоит перечислять сколько заплатит каждый. Это же будет одно и то же число

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.

А как же быть с ситуацией когда будет, например 3 человека, а сумма 133 рубля? т.е. при делении будет 44.33x3 = 132.99. В моём коде последнему покажет система не 44.33, а 44.34. Т.е. будет 44.33, 44.33, 44.34. Все копейки учтены.

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

Choose a reason for hiding this comment

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

image

Мне кажется баг не пофикшен.

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.

Мне кажется баг не пофикшен.
Очень стыдно, честно. Отправляю третий, последний раз.

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.

Проверил, теперь корректно. Надо было банально потратить время и хорошо протестировать, зациклился на значениях свыше 100 и остатке от деления % 100. Буду впредь внимательнее.

@@ -0,0 +1,32 @@
public class Formatter {

//public String RubDesc = "";
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.

Спасибо, забыл почистить мусор.

System.out.println(arrayOfProductsPrices.get(i).productName);
}

void cutSummPpl() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cutSummPpl - если имелось ввиду "Разделить счет на всех", то я бы назвал splitSumToPerson

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.

Спасибо, слово не пришло нормальное для функции.

@Heijin
Copy link
Copy Markdown
Owner Author

Heijin commented Apr 21, 2023

Не понял как отправить пулл реквест повторно. Мои коммиты видны?

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