Skip to content

Сдача 1ПР - #1

Open
Garret944 wants to merge 4 commits into
devfrom
main
Open

Garret944 wants to merge 4 commits into
devfrom
main

Conversation

@Garret944

Copy link
Copy Markdown
Owner

1-я проектная работа, 1-я итерация

Comment thread src/main/java/peopleCounter.java Outdated
@@ -0,0 +1,24 @@
import java.util.Scanner;

public class peopleCounter {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Классы по код стилю нужно называть в PascalCase

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 thread src/main/java/Main.java Outdated
default:
ruble = "рублей";

System.out.println(foodList + "\n" + String.format(totalResult, priceSum) + " руб." + "\n" + String.format(personalResult, eachPay) + " " + ruble);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В таких случаях для вывода лучше использовать System.out.printf, ему можно передать параметры, которые будут подставлены в строку.

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 thread src/main/java/Main.java
if (foodPrice < 0) {
System.out.println("Стоимость блюда не может быть меньше 0, введите верное значение");
} else {
System.out.println("Блюдо " + foodName + " за " + foodPrice + " руб. добавлено." + "\n" + "Добавьте еще одно блюдо или введите 'Завершить', чтобы узнать, сколько вы должны заплатить.");

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 thread src/main/java/Main.java
String totalResult = "Общая сумма - %.2f";
String personalResult = "Каждый должен заплатить по %.2f";
String ruble;
if ((int) eachPay % 100 >= 10 && (int) eachPay % 100 <= 20) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

На самом деле будет достаточно проверить интервал от 11 до 14 включительно

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 thread src/main/java/peopleCounter.java Outdated
Comment thread src/main/java/Main.java Outdated
Comment thread src/main/java/Main.java Outdated
@Garret944

Copy link
Copy Markdown
Owner Author

критические ошибки исправлены, также исправлена часть некритических

@Garret944 Garret944 closed this Jan 18, 2023
@Garret944 Garret944 reopened this Jan 18, 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