Created
May 12, 2014 08:31
-
-
Save valdiney/eab0fff7fb5113a8a566 to your computer and use it in GitHub Desktop.
Relacionamento: Associação, Agregação de Composição.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by SharpDevelop. | |
* User: ruan | |
* Date: 11/05/2014 | |
* Time: 11:00 | |
* | |
* To change this template use Tools | Options | Coding | Edit Standard Headers. | |
*/ | |
using System; | |
namespace agregacao_aluguel | |
{ | |
class Cliente | |
{ | |
public string nome; | |
} | |
class Apartamento | |
{ | |
public int numeroDo_quarto; | |
public int periodoAvuguel; | |
public Cliente cliente; | |
} | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var cliente = new Cliente(); | |
var apartamento = new Apartamento(); | |
apartamento.cliente = cliente; | |
cliente.nome = "Valdiney França"; | |
apartamento.numeroDo_quarto = 112; | |
apartamento.periodoAvuguel = 15; | |
Console.WriteLine("Cliente : " + cliente.nome); | |
Console.WriteLine("Número de quarto é : " + apartamento.numeroDo_quarto); | |
Console.WriteLine("Dias alugados : " + apartamento.periodoAvuguel); | |
Console.Write("Press any key to continue . . . "); | |
Console.ReadKey(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment