Skip to content

Instantly share code, notes, and snippets.

@valdiney
Created May 12, 2014 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valdiney/eab0fff7fb5113a8a566 to your computer and use it in GitHub Desktop.
Save valdiney/eab0fff7fb5113a8a566 to your computer and use it in GitHub Desktop.
Relacionamento: Associação, Agregação de Composição.
/*
* 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