示例#1
0
        static void Main(string[] args)
        {
            int answer = 0;

            do
            {
                Console.WriteLine("1. Pridanie obyvatela");
                Console.WriteLine("2. Vypis obyvatelov bytu");
                Console.WriteLine("3. Vybranie bytu");
                Console.WriteLine("4. Vypis bytu");
                Console.WriteLine("5. KONIEC");
                Console.Write("Vas vyber: ");

                answer = int.Parse(Console.ReadLine());
                switch (answer)
                {
                case 1: AddHabitan(); break;

                case 2: Flat.GetInfoAboutAllHabitants(); break;

                case 3: AddNewFlat(); break;

                case 4: Entrance.GetInfoAboutAllFlats(); break;
                }
            } while (!(answer == 5));
            Console.WriteLine("KONIEC");
        }
        static void Main(string[] args)
        {
            Person Jozef = new Person("Jozef", "Mrkvička", 22);

            Console.WriteLine(Jozef.ToString());

            Flat flat1 = new Flat(1, 250, 3);

            Console.WriteLine(flat1.ToString());

            Flat flat2 = new Flat(1, 250, 3);

            Console.WriteLine(flat2.ToString());

            Person miro = new Person("Miro", "Silný", 20);

            flat1.AddHabitant(miro);

            Person stefan = new Person("Štefan", "Chudý", 25);

            flat1.AddHabitant(stefan);

            Console.WriteLine(flat1.GetInfoAboutAllHabitants());
            Console.WriteLine(miro.GetInfoAboutFlat());
        }
示例#3
0
        static void Main(string[] args)
        {
            Habitant a = new Habitant("Palo", "Hodás", 16);
            Habitant b = new Habitant("Miloš", "Hodás", 46);
            Habitant c = new Habitant("Pter", "Hodás", 18);
            Habitant d = new Habitant("Katarína", "Hodásová", 41);

            Person administrator = new Person("Ferdinand", "Káblovec", 55);
            Person charwoman     = new Person("Ivka", "Rýchla", 60);

            Flat flat  = new Flat(1, "100m²", 5);
            Flat flat2 = new Flat(2, "100m²", 4);


            Entrace entrace1 = new Entrace(1, 7, 14);
            Entrace entrace2 = new Entrace(2, 7, 14);
            Entrace entrace3 = new Entrace(3, 7, 14);
            Entrace entrace4 = new Entrace(4, 7, 14);

            BlockOfFlats blockOfFlats1 = new BlockOfFlats("A1", "Štefániková");
            BlockOfFlats blockOfFlats2 = new BlockOfFlats("A2", "Záriečská");

            HausingEstate hausingEstate = new HausingEstate("Vlčince");


            Console.WriteLine(hausingEstate.ToString());
            Console.WriteLine();

            Console.WriteLine("ZARADENIE ČLOVEK - BYT - VCHOD:");
            Console.WriteLine("zadajte stranu na ktorej je byt- L, R");
            Console.WriteLine(hausingEstate.AddHabitant(a, flat, entrace1, entrace3, blockOfFlats1));
            Console.WriteLine(hausingEstate.AddHabitant(b, flat, entrace2, entrace4, blockOfFlats2));


            Console.WriteLine();
            Console.WriteLine("VŠETCI OBYVATELIA BYTOV:");
            Console.WriteLine(flat.GetInfoAboutAllHabitants());

            Console.WriteLine();
            Console.WriteLine("ZARADOVANIE OBYVATELOV DO BYTOV:");
            Console.WriteLine(a.GetInfoAboutFlat(a, flat));

            Console.WriteLine();
            Console.WriteLine("PRACOVNÍCI:");
            Console.WriteLine("správca: " + administrator);
            Console.WriteLine("upratovačka: " + charwoman);

            Console.WriteLine();
            Console.WriteLine(blockOfFlats1.ToString());
        }
示例#4
0
        static void Main(string[] args)
        {
            Habitant v = new Habitant(50, "Zdeno", "Chara");
            Habitant u = new Habitant(12, "Jana", "Hlavata");
            Habitant i = new Habitant(45, "Peter", "Hlavaty");
            Habitant o = new Habitant(40, "Andrea", "Hlavata");

            Flat flat  = new Flat(32, 60, 3);
            Flat flat2 = new Flat(23, 70, 4);

            Entrance      entrance      = new Entrance(35, 13, 26);
            Entrance      entrance1     = new Entrance(37, 13, 26);
            BlockOfFlats  blockOfFlats  = new BlockOfFlats(33, "Kollarova");
            HousingEstate housingEstate = new HousingEstate();



            Console.WriteLine(v.ToString());
            Console.WriteLine(flat.ToString());
            flat.AddHabitant(v);
            flat.AddHabitant(u);
            flat.AddHabitant(i);
            flat2.AddHabitant(o);
            Console.WriteLine(u.currentFlat.NumberOfRooms);
            Console.WriteLine(flat.GetInfoAboutAllHabitants());
            Console.WriteLine(flat.NumberOfFlats);
            Console.WriteLine(o.GetInfoAboutFlat());
            Console.WriteLine(entrance.NumberOfEntrance);
            blockOfFlats.AddEntrance(entrance);
            blockOfFlats.AddEntrance(entrance1);
            blockOfFlats.AddFlat(flat);
            Console.WriteLine(blockOfFlats);
            Console.WriteLine(blockOfFlats.GetInfoAboutAllEntrances());
            Console.WriteLine(blockOfFlats.GetInfoAboutAllFlats());
            housingEstate.AddBlockOfFlats(blockOfFlats);
            Console.WriteLine(housingEstate.GetInfoAboutAllBlockOfFlats());
            Console.WriteLine(housingEstate.GetNumberOfBlockOfFlats());
        }