forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
16 lines (14 loc) · 924 Bytes
/
Main.java
File metadata and controls
16 lines (14 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class Main {
int result;
public static void main(String[] args) {
CountingPeople count = new CountingPeople(); // Отдельный класс подсчета кол-ва людей;
int result = count.calculate(); // Считаем кол-во людей;
newGoodGenerator generator = new newGoodGenerator(); // Калькулятор из задания наывается в моем решении генератором;
do{
generator.generateNewGood(); // Создаем первый товар;
} while (generator.askingMoreGoods()); // Тут спрашиваем нужны ли еще товары;
// System.out.println("Добавили все товары, какие мы хотели");
generator.showTotalPrice();
generator.bill(result); // Метод проводит расчет по покупкам;
}
}