Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter flat style: (light or dark)");
            string flatStyle = Console.ReadLine();

            Flat flat = new Flat();

            //todo
            IRoomFactory factory = CreateFactory(flatStyle);

            flat.Room1   = factory.CreateRoom();
            flat.Room2   = factory.CreateRoom();
            flat.Balcony = factory.CreateBalcony();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter flat style: (light or dark)");
            string flatStyle = Console.ReadLine();

            Flat flat = new Flat();

            flat.Room1 = SetRoomStyle(flatStyle);
            flat.Room2 = SetRoomStyle(flatStyle);

            Console.WriteLine("Room 1:");
            PrintRoomStyle(flat.Room1);
            Console.WriteLine("Room 2:");
            PrintRoomStyle(flat.Room2);
            Console.ReadKey();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //Оратівський Сергій. ПЗС-2044. 2020р.
            Console.WriteLine("Оратiвський Сергiй. ПЗС-2044");
            Flat flat = new Flat();
            var  inp  = flat.Input();
            Flat o1   = new Flat {
                Cost = inp[0], Area = inp[1]
            };
            Flat o2 = new Flat {
                Cost = inp[2], Area = inp[3]
            };
            String query;

            Console.WriteLine("Введите знак: == ; = ; >");
            query = Convert.ToString(Console.ReadLine());
            switch (query)
            {
            case "==":
                if (o1 == o2)
                {
                    Console.WriteLine("Площадь квартир одинаковая");
                }
                else
                {
                    Console.WriteLine("Площади квартир разные");
                }
                break;

            case "=":
                Flat o3 = o1;
                Console.WriteLine("Мы присвоили значения первого обьекта в новый третий обьект");
                Console.WriteLine(o3.Cost + " " + o3.Area);
                break;

            case ">":
                if (o1 > o2)
                {
                    Console.WriteLine("Первая квартира дороже");
                }
                else
                {
                    Console.WriteLine("Вторая квартира дороже");
                }
                break;
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string choice;
            string colorScheme;

            Console.WriteLine("You are about to make home improvements.");
            Console.WriteLine("Now you have to choose a color scheme.");
            Console.WriteLine("Please, type 1 for light style or 2 for dark style.");
            Console.Write("Enter your choice: ");
            choice = Console.ReadLine();

            switch (choice)
            {
            case "1":
                colorScheme = "light";
                break;

            case "2":
                colorScheme = "dark";
                break;

            default:
                colorScheme = "dark";
                break;
            }

            Flat flat = new Flat(colorScheme);

            Console.WriteLine("Your flat color scheme is {0}.", flat._colourScheme);

            Console.WriteLine("Your Room1 wallpaper is {0}.", flat._room1._wallpaper);
            Console.WriteLine("Your Room1 chandelier is {0}.", flat._room1._chandelier);

            Console.WriteLine("Your Room2 wallpaper is {0}.", flat._room2._wallpaper);
            Console.WriteLine("Your Room2 chandelier is {0}.", flat._room2._chandelier);

            Console.Write("Press any key to close the application: ");
            Console.ReadLine();
        }
Ejemplo n.º 5
0
        static void Main()
        {
            Console.WriteLine("You are about to make home improvements.");
            Console.WriteLine("Now you have to choose a color scheme.");
            Console.WriteLine("Please, type 1 for light style or 2 for dark style.");
            Console.Write("Enter your choice: ");

            string choice = Console.ReadLine();

            IRoomFactory factory = CreateFactory(choice);

            var flat = new Flat {
                Room1 = factory.CreateRoom(), Room2 = factory.CreateRoom()
            };

            Console.WriteLine("Your Room1 wallpaper is {0}.", flat.Room1.Wallpaper.Color);
            Console.WriteLine("Your Room1 chandelier is {0}.", flat.Room1.Chandelier.Color);

            Console.WriteLine("Your Room2 wallpaper is {0}.", flat.Room2.Wallpaper.Color);
            Console.WriteLine("Your Room2 chandelier is {0}.", flat.Room2.Chandelier.Color);

            Console.Write("Press any key to close the application: ");
            Console.ReadLine();
        }