-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPessoa.java
More file actions
executable file
·54 lines (37 loc) · 1.41 KB
/
Pessoa.java
File metadata and controls
executable file
·54 lines (37 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
public class Pessoa {
public static final int COMPLETO = 0;
public static final int SIMPLIFICADO = 1;
private String nome;
private String cpf;
public Pessoa(String _nome, String _cpf){
this.nome = _nome;
this.cpf = _cpf;
}
public String relatorioImostoRenda(ImpostoRenda i, int tipo){
String temp = null;
temp = "Dados Pessoais \n";
temp = temp + "Nome:" + this.nome + "\n";
temp = temp + "Cpf:" + this.cpf + "\n";
temp = temp + "Dados do Calculo \n";
if (tipo == Pessoa.COMPLETO){
temp = temp + "Imposto Completo \n";
temp = temp + "Gastos Com Saúde:" + ((ImpostoCompleto)i).getGastoSaude() + "\n";
temp = temp + "Gastos Com Educação:" + ((ImpostoCompleto)i).getGastoEducacao() + "\n";
} else {
temp = temp + "Imposto Simplificado \n";
}
temp = temp + "Renda Bruta:" + i.getRendaBruta() +"\n";
temp = temp + "Valor a Pagar:" + i.calculo() +"\n";
return temp;
}
public static void main(String[] args) {
Pessoa p = new Pessoa("Eduardo Jorge", "88777008-45");
ImpostoRenda i = new ImpostoCompleto(100000, 2005, 2600, 10000);
i.processamento(2005);
System.out.println(p.relatorioImostoRenda(i, Pessoa.COMPLETO));
Pessoa p1 = new Pessoa("Camila Silva", "900007008-21");
ImpostoRenda i1 = new ImpostoSimplificado(50000, 2005);
i1.processamento(2005);
System.out.println(p1.relatorioImostoRenda(i1, Pessoa.SIMPLIFICADO));
}
}