Beispiel #1
0
        public static void ActionMenu()
        {
            int x;
            int z;
            int y;

            Console.WriteLine("WHAT DO YOU WANT TO DO?");
            Console.WriteLine("1 - ACTION WITH HOOVER      2 - ACTION WITH FLASHLIGHT    3 - ADD    4 - MORE POWER     5 - LESS POWER");
            x = Convert.ToInt32(Console.ReadLine());

            if (x == 1)
            {
                Console.WriteLine("The Hoover:");
                Console.WriteLine("1 - PLUG IN   2 - PLUG OFF   3 - TURN ON   4 - TURN OFF   5 - FAST MODE ON   6 - FAST MODE OFF");
                z = Convert.ToInt32(Console.ReadLine());

                if (z == 1)
                {
                    Hoover Hoover1 = new Hoover("BenQ", "With cable", 4, 4, 100);
                    Hoover1.PlugIn();
                    ActionMenu();
                }

                if (z == 2)
                {
                    Hoover Hoover1 = new Hoover("BenQ", "With cable", 4, 4, 100);
                    Hoover1.PlugOff();
                    ActionMenu();
                }

                if (z == 3)
                {
                    Hoover Hoover1 = new Hoover("BenQ", "With cable", 4, 4, 100);
                    Hoover1.TurnOn();
                    ActionMenu();
                }

                if (z == 4)
                {
                    Hoover Hoover1 = new Hoover("BenQ", "With cable", 4, 4, 100);
                    Hoover1.TurnOff();
                    ActionMenu();
                }

                if (z == 5)
                {
                    Hoover Hoover1 = new Hoover("BenQ", "With cable", 4, 4, 100);
                    Hoover1.FastModeOn();
                    ActionMenu();
                }

                if (z == 6)
                {
                    Hoover Hoover1 = new Hoover("BenQ", "With cable", 4, 4, 100);
                    Hoover1.FastModeOff();
                    ActionMenu();
                }
            }

            if (x == 2)
            {
                Console.WriteLine("The Flashlight:");
                Console.WriteLine("1 - PUT BATTERY IN   2 - TURN ON   3 - TURN OFF   4 - BETTER LIGHT ON   5 - BETTER LIGHT OFF");
                y = Convert.ToInt32(Console.ReadLine());

                if (y == 1)
                {
                    Flashlight Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                    Flashlight1.PutBatteryIn();
                    ActionMenu();
                }

                if (y == 2)
                {
                    Flashlight Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                    Flashlight1.TurnOn();
                    ActionMenu();
                }

                if (y == 3)
                {
                    Flashlight Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                    Flashlight1.TurnOff();
                    ActionMenu();
                }

                if (y == 4)
                {
                    Flashlight Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                    Flashlight1.BetterLightOn();
                    ActionMenu();
                }

                if (y == 5)
                {
                    Flashlight Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                    Flashlight1.BetterLightOff();
                    ActionMenu();
                }
            }

            if (x == 3)
            {
                Hoover      Hoover1     = new Hoover("BenQ", "With cable", 4, 4, 100);
                Flashlight  Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                FlashHoover F           = new FlashHoover();
                Flashlight1.Add();
                ActionMenu();
            }

            if (x == 4)
            {
                Hoover      Hoover1     = new Hoover("BenQ", "With cable", 4, 4, 100);
                Flashlight  Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                FlashHoover F           = new FlashHoover();
                Flashlight1.More();
                ActionMenu();
            }

            if (x == 5)
            {
                Hoover      Hoover1     = new Hoover("BenQ", "With cable", 4, 4, 100);
                Flashlight  Flashlight1 = new Flashlight("Luna", 20, 1, 50);
                FlashHoover F           = new FlashHoover();
                Flashlight1.Less();
                ActionMenu();
            }

            Console.ReadKey();
        }