forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalculate.java
More file actions
37 lines (26 loc) · 779 Bytes
/
Calculate.java
File metadata and controls
37 lines (26 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
public class Calculate {
double summa;
public void addsum ( double price) {
this.summa = summa + price;
}
public void calculate (int quantity) {
Formatter formatter = new Formatter();
double floortotalPrice = (this.summa / quantity);
String messageTemplate = "Сумма к оплате с одного человека: %.2f "+ " " + formatter.formate(floortotalPrice);
System.out.printf(messageTemplate, floortotalPrice) ;
}
public double getSumma() {
return summa;
}
public void setSumma(double summa) {
this.summa = summa;
}
public Calculate(double summa) {
this.summa = summa;
}
public double getPrice() {
double price;
price = 0;
return price;
}
}