Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace YaYuniorLesson8_OOP
- {
- class Program
- {
- static void Main(string[] args)
- {
- House house = new House(ConsoleColor.Blue, "Lenina,6", 15);
- string ad = house.Adress;
- Console.WriteLine(ad);
- ConsoleColor tempFc = Console.ForegroundColor;
- Console.WriteLine(house.HouseAdress());
- Console.ForegroundColor = tempFc;
- }
- }
- class Tenant
- {
- public string Name;
- public int Age;
- public Tenant(string name, int age)
- {
- Name = name;
- Age = age;
- }
- }
- class House
- {
- public ConsoleColor Color;
- public string Adress;
- public int MaxNum;
- private Tenant[] Group;
- public House(ConsoleColor color, string adress, int maxnum)
- {
- Color = color;
- Adress = adress;
- MaxNum = maxnum;
- Group = new Tenant[maxnum];
- }
- public string HouseAdress()
- {
- ConsoleColor tempFc = Console.ForegroundColor;
- Console.ForegroundColor = Color;
- return Adress;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement