Example #1
0
            public static FlashHoover operator +(Hoover Hoover1, Flashlight Flashlight1)
            {
                FlashHoover F = new FlashHoover();

                F.Power = Flashlight1.Power2 + Hoover1.Power1;
                return(F);
            }
Example #2
0
            public void Add()
            {
                FlashHoover F           = new FlashHoover();
                Hoover      Hoover1     = new Hoover("BenQ", "With cable", 4, 4, 100);
                Flashlight  Flashlight1 = new Flashlight("Luna", 20, 1, 50);

                F = Hoover1 + Flashlight1;
                Console.WriteLine("Power sum: " + F);
            }
Example #3
0
            public void Less()
            {
                FlashHoover F           = new FlashHoover();
                Hoover      Hoover1     = new Hoover("BenQ", "With cable", 4, 4, 100);
                Flashlight  Flashlight1 = new Flashlight("Luna", 20, 1, 50);

                if (Hoover1 < Flashlight1)
                {
                    Console.WriteLine("Flaslight consumes less power");
                }
            }
Example #4
0
            public void More()
            {
                FlashHoover F           = new FlashHoover();
                Hoover      Hoover1     = new Hoover("BenQ", "With cable", 4, 4, 100);
                Flashlight  Flashlight1 = new Flashlight("Luna", 20, 1, 50);

                if (Hoover1 > Flashlight1)
                {
                    Console.WriteLine("Hoover consumes more power");
                }
            }
Example #5
0
            public static bool operator <(Hoover Hoover1, Flashlight Flashlight1)
            {
                FlashHoover F = new FlashHoover();

                bool status = false;

                if (Flashlight1.Power2 < Hoover1.Power1)
                {
                    status = true;
                }
                return(status);
            }
Example #6
0
            public static bool operator >(Hoover Hoover1, Flashlight Flashlight1)
            {
                bool status = false;

                FlashHoover F = new FlashHoover();

                if (Hoover1.Power1 > Flashlight1.Power2)
                {
                    status = true;
                }
                return(status);
            }
Example #7
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();
        }