Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main ( string [] args )
- {
- House mylonelyhouse = new House ( ConsoleColor.Red, "Dnishche", 10 );
- mylonelyhouse.ShowAdress ();
- }
- }
- class House
- {
- ConsoleColor HouseColor;
- string Adress;
- int MaxTenants;
- private Tenant [] Tenants;
- public House ( ConsoleColor col, string adr, int max )
- {
- HouseColor = col;
- Adress = adr;
- MaxTenants = max;
- Tenants = new Tenant [max];
- }
- public void ShowAdress ( )
- {
- Console.ForegroundColor = HouseColor;
- Console.WriteLine (Adress);
- Console.ForegroundColor = ConsoleColor.White;
- }
- }
- class Tenant
- {
- string Name;
- byte Age;
- public Tenant (string name, byte age)
- {
- Name = name;
- Age = age;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement