26.08.2014 Views

C# e Orientação a Objetos

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

177 RESPOSTAS<br />

1 class TestaControleDePonto<br />

2 {<br />

3 static void Main ()<br />

4 {<br />

5 Gerente g = new Gerente ();<br />

6 g. Codigo = 1;<br />

7 g. Usuario = " rafael . cosentino ";<br />

8 g. Senha = " 12345 ";<br />

9<br />

10 Telefonista t = new Telefonista ();<br />

11 t. Codigo = 2;<br />

12 t. Ramal = 13;<br />

13<br />

14 ControleDePonto cdp = new ControleDePonto ();<br />

15<br />

16 cdp . RegistraEntrada (g);<br />

17 cdp . RegistraEntrada (t);<br />

18<br />

19 cdp . RegistraSaida (g);<br />

20 cdp . RegistraSaida (t);<br />

21 }<br />

22 }<br />

Código <strong>C#</strong> 9.17: TestaControleDePonto.cs<br />

Resposta do Exercise 10.2<br />

1 class Funcionario<br />

2 {<br />

3 public double Salario { get ; set ; }<br />

4 }<br />

Código <strong>C#</strong> 10.18: Funcionario.cs<br />

Resposta do Exercise 10.3<br />

1 class TestaFuncionario<br />

2 {<br />

3 static void Main ()<br />

4 {<br />

5 Funcionario f = new Funcionario ();<br />

6<br />

7 f. Salario = 3000;<br />

8<br />

9 System . Console . WriteLine (f. Salario );<br />

10 }<br />

11 }<br />

Código <strong>C#</strong> 10.19: TestaFuncionario.cs<br />

Resposta do Exercise 10.4<br />

www.facebook.com/k19treinamentos 177

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!