forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutput.java
More file actions
22 lines (15 loc) · 767 Bytes
/
Output.java
File metadata and controls
22 lines (15 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.ArrayList;
public class Output {
public void output(ArrayList<String> listOfFood, float totalAmount, int persons) {
Calculator calculator = new Calculator();
RubEnding rubEnding = new RubEnding();
float score = totalAmount / persons;
String end = rubEnding.generateEnding(score);
String end2 = rubEnding.generateEnding(totalAmount);
calculator.printListOfFood(listOfFood);
String messageTemplate = "\nОБЩАЯ СУММА\n%.2f%s";
System.out.printf((messageTemplate) + "%n", totalAmount, end2);
String messageTemplate2 = "Каждый человек должен заплатить %.2f%s";
System.out.printf((messageTemplate2) + "%n", score, end);
}
}