Skip to content

Практическая работа по первому спринту, правка1 - #2

Merged
Djankoq merged 4 commits into
mainfrom
dev
Nov 29, 2023
Merged

Djankoq merged 4 commits into
mainfrom
dev

Conversation

@Djankoq

@Djankoq Djankoq commented Nov 26, 2023

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/main/java/Main.java
System.out.println("Каждый должен заплатить " + String.format("%.2f", part) + " " + howToWriteRubles(part));
}

public static int countPersons() { //метод для подсчета числа посетителей

@nasibullin1412 nasibullin1412 Nov 27, 2023 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🍏static лишнее здесь, а так же этот метод можно вынести в отдельный класс

Comment thread src/main/java/Main.java Outdated
}
}

class Goods{ // Создаем класс со статическими переменными, хранящие сумму заказа и названия товаров

Copy link
Copy Markdown

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/Goods.java
Comment on lines +6 to +7
static double sum = 0;
static String names = "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🍏 Необязательно их было делать static. По хорошему, один объект класса Good должен был соответствовать одному товару, а метод calculator лучше было сделать классом Calculator с методом calculate (названия классов - существительные, названия методов - желательно глаголы).

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