-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathImpostoCompleto.java
More file actions
executable file
·38 lines (29 loc) · 930 Bytes
/
ImpostoCompleto.java
File metadata and controls
executable file
·38 lines (29 loc) · 930 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
public class ImpostoCompleto extends ImpostoRenda {
private double gastoEducacao;
private double gastoSaude;
public ImpostoCompleto(double _rendaBruta, int _ano){
super(_rendaBruta, _ano);
this.gastoEducacao = _rendaBruta * .1;
this.gastoSaude = this.gastoEducacao;
}
public ImpostoCompleto(double _rendaBruta, int _ano, double _gastoEducacao, double _gastoSaude) {
super(_rendaBruta, _ano);
this.gastoEducacao = _gastoEducacao;
this.gastoSaude = _gastoSaude;
}
public double getGastoEducacao(){
return this.gastoEducacao;
}
public double getGastoSaude(){
return this.gastoSaude;
}
public double calculo() {
if (this.rendaBruta >= 100000)
this.valorPagar = this.rendaBruta * .27;
else if (this.rendaBruta < 50000)
this.valorPagar = this.rendaBruta * .12;
else
this.valorPagar = this.rendaBruta * .23;
return this.valorPagar - this.gastoEducacao - this.gastoSaude;
}
}