-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cliente.cs
35 lines (31 loc) · 819 Bytes
/
Cliente.cs
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
namespace CaixaEletronico
{
class Cliente
{
public string Nome { get; set; }
public string rg;
public string cpf;
public string endereco;
public int idade;
public bool EEmancipado { get; set; }
public Cliente(string nome)
{
this.Nome = nome;
}
public Cliente() { }
public bool EhMaiorDeIdade()
{
return this.idade >= 18;
}
public bool PodeAbrirContaSozinho
{
get
{
var maiorDeIdade = this.EhMaiorDeIdade();
var emancipado = this.EEmancipado;
var possuiCPF = !string.IsNullOrEmpty(this.cpf);
return (maiorDeIdade || emancipado) && possuiCPF;
}
}
}
}