-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHD.java
More file actions
executable file
·35 lines (26 loc) · 1022 Bytes
/
HD.java
File metadata and controls
executable file
·35 lines (26 loc) · 1022 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
public class HD extends MemoriaS {
private String numeroSerie;
public HD(String newNumeroSerie, int newTotal, int newUnidade) {
super(newTotal, newUnidade);
this.numeroSerie = newNumeroSerie;
}
public double getPerda() {
return (this.total / 10240) / 100;
}
public double getEspacoDisponivelRealKB() {
//return this.getEspacoDisponivelKB() * (1 - (this.getEspacoDisponivelKB() * this.getPerda()));
return this.getEspacoDisponivelKB() - ((this.getEspacoDisponivelKB() * this.getPerda()) / 100);
}
public String getNumeroSerie(){
return this.numeroSerie;
}
public String toString(){
String _tmp = "HD Número de Serie " + this.numeroSerie + "\n";
_tmp += "Percentual Disponível " + this.getPercentualDisponivel() + "%\n";
_tmp += "Espaço Total " + this.total + "KB\n";
_tmp += "Espaço Disponível Real " + this.getEspacoDisponivelRealKB() + "KB\n";
_tmp += "Espaço utilizado " + this.getUtilizadoKB() + "\n";
_tmp += "Perda " + this.getPerda() + "%";
return _tmp;
}
}