Advertisement
kisame1313

Untitled

Jul 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main ( string [] args )
  6.     {
  7.         House mylonelyhouse = new House ( ConsoleColor.Red, "Dnishche", 10 );
  8.         mylonelyhouse.ShowAdress ();
  9.     }
  10. }
  11.  
  12. class House
  13. {
  14.     ConsoleColor HouseColor;
  15.     string Adress;
  16.     int MaxTenants;
  17.     private Tenant [] Tenants;
  18.  
  19.     public House ( ConsoleColor col, string adr, int max )
  20.     {
  21.         HouseColor = col;
  22.         Adress = adr;
  23.         MaxTenants = max;
  24.         Tenants = new Tenant [max];
  25.     }
  26.  
  27.     public void ShowAdress ( )
  28.     {
  29.         Console.ForegroundColor = HouseColor;
  30.         Console.WriteLine (Adress);
  31.         Console.ForegroundColor = ConsoleColor.White;
  32.     }
  33. }
  34.  
  35. class Tenant
  36. {
  37.     string Name;
  38.     byte Age;
  39.  
  40.     public Tenant (string name, byte age)
  41.     {
  42.         Name = name;
  43.         Age = age;
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement