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 ConsoleApp1
- {
- class Building
- {
- public int Floors;
- public int Area;
- public int Occupants;
- //площа на одного чоловіка
- public int AreaPerPerson ()
- {
- return Area / Occupants;
- }
- //максимальна кількість людей на задану площу
- //виходячи від заданої мінімальної площі на 1 особу.
- public int MaxOccupans (int minArea)
- {
- return Area / minArea;
- }
- public Building( int Floors, int A, int O)
- {
- this.Floors = Floors;
- Area = A;
- Occupants = O;
- }
- static void Main(string[] args)
- {
- Building House = new Building(5, 2500, 80);
- Building offis = new Building(100, 9000, 1000);
- Console.WriteLine("найбільша кількість людей у будинку,\n" +
- "Якщо на кожну особу надається 300 квад.м.\n"
- + House.MaxOccupans(300) + " \n площа на одного чоловіка \n"
- + House.AreaPerPerson() + " \n Кількість Жителів \n"
- + House.Occupants);
- Console.WriteLine("найбільша кількість людей у Офісі,\n" +
- "Якщо на кожну особу надається 300 квад.м.\n"
- + offis.MaxOccupans(300) + "\n площа на одного чоловіка \n"
- + offis.AreaPerPerson() + " \n Кількість Жителів \n"
- + offis.Occupants);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement