-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComanda.java
More file actions
40 lines (35 loc) · 889 Bytes
/
Copy pathComanda.java
File metadata and controls
40 lines (35 loc) · 889 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
37
38
39
40
public class Comanda
{
private String consumo;
public String getConsumo() {
return consumo;
}
public void setConsumo(String consumo) {
this.consumo = consumo;
}
private double valorTotal;
public double getValorTotal() {
return valorTotal + this.calc10Pc();
}
public void setValorTotal(double valorTotal) {
this.valorTotal = valorTotal;
}
public Comanda() {
this.consumo = "";
this.valorTotal = 0.0;
}
public void listarConsumo() {
System.out.printf(consumo);
}
public double calc10Pc(){
return this.valorTotal * 0.1;
}
public double dividirConta(int pessoas){
if(pessoas > 0){
return this.getValorTotal() / pessoas;
}
else{
return 0.0;
}
}
}