-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEstacionamento.java
More file actions
58 lines (46 loc) · 1.41 KB
/
Estacionamento.java
File metadata and controls
58 lines (46 loc) · 1.41 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package estacionamento;
public class Estacionamento {
private String Placa;
private Tempo HoraEntrada;
private Tempo HoraSaida;
private double ValorPago;
private String Status;
public Estacionamento(String P, int H, int M, String Status) {
this.HoraEntrada = new Tempo(H, M);
this.Placa = P;
this.Status = Status;
}
public void CalcularValor() {
int S = HoraSaida.Subtrair(HoraEntrada);
S = S / 15;
ValorPago = S * 3;
}
public void RegistrarSaida(int H, int M) {
HoraSaida = new Tempo(H, M);
CalcularValor();
}
public static String TransformaEst(Estacionamento Est[]) {
String p = "";
for (int i = 0; Est[i] != null; i++) {
p = p + Est[i];
}
return p;
}
public String toString() {
return "Placa: " + getPlaca() + "\n" + "Hora de Entrada: " + HoraEntrada
+ "\n" + "Hora de Saída: " + HoraSaida + "\n" + "Valor: " +
ValorPago + "\n" + "Status: " + getStatus() + "\n";
}
public String getPlaca() {
return Placa;
}
public void setValorPago(double ValorPago) {
this.ValorPago = ValorPago;
}
public String getStatus() {
return Status;
}
public void setStatus(String Status) {
this.Status = Status;
}
}