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
19 lines (19 loc) · 842 Bytes
/
Main.java
File metadata and controls
19 lines (19 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class Main {
public static void main(String[] args) {
System.out.println("Калькулятор счёта");
int number;
float sum;
float allPrice;
Calculator calc = new Calculator();
number = calc.scannerNumber();
Product prod = new Product();
prod = calc.scannerProducts(prod);
System.out.println("Добавленные товары:");
System.out.println(prod.getProducts());
sum = prod.getPrice() / number;
allPrice = prod.getPrice();
Formatter format = new Formatter();
System.out.printf("Общая сумма: %,.2f %s\n", allPrice, format.formatSum(allPrice));
System.out.printf("Сумма которую должен заплатить каждый: %,.2f %s", sum, format.formatSum(sum));
}
}