public void repairFleetNames(string RobotBrand, int RobotBatteryLevel)
        {
            robotBrand        = RobotBrand;
            robotBatteryLevel = RobotBatteryLevel;

            AmericanRobot newAmerican = new AmericanRobot("Brad", "Apple", 100);
            JapaneseRobot newJapanese = new JapaneseRobot("Craig", "Sony", 100);
            AfricanRobot  newAfrican  = new AfricanRobot("Devin", "Samsung", 100);
            RussianRobot  newRussian  = new RussianRobot("Luke", "Toshiba", 100);


            List <Robot> repairFleet = new List <Robot>();

            repairFleet.Add(newAmerican);
            repairFleet.Add(newJapanese);
            repairFleet.Add(newAfrican);
            repairFleet.Add(newRussian);

            Console.WriteLine("Here is your fleet of Repair Robots");
            Console.WriteLine("----------------------");
            Console.WriteLine(newAmerican.robotName);
            Console.WriteLine(newJapanese.robotName);
            Console.WriteLine(newAfrican.robotName);
            Console.WriteLine(newRussian.robotName);

            Console.WriteLine("Repair fleet at your service!");
        }
예제 #2
0
        public void MenuRobot()
        {
            Console.WriteLine("Welcome to the World Wide Robot Foundation!");
            Console.WriteLine("Please choose your choice of robot.");
            Console.WriteLine("----------------------");
            Console.WriteLine("1. American Robot (will interact with another robot)");
            Console.WriteLine("2. Japanese Robot");
            Console.WriteLine("3. African Robot");
            Console.WriteLine("4. Russian Robot");
            Console.WriteLine("5. Exit");

            int choice;

            choice = Convert.ToInt32(Console.ReadLine());

            if (choice == 1)
            {
                AmericanRobot newAmerican = new AmericanRobot("Robbie", "Apple", 100);
                Console.WriteLine("Hello I'm Robbie!. Nice to meet you!");
                newAmerican.americanGunShots();
            }
            else if (choice == 2)
            {
                JapaneseRobot newJapanese = new JapaneseRobot("Wallie", "Sony", 100);
                Console.WriteLine("Konnichiwa! I am Wallie! Nice to meet you!");
                newJapanese.japaneseScreaming();
            }
            else if (choice == 3)
            {
                AfricanRobot newAfrican = new AfricanRobot("Dodger", "Samsung", 100);
                Console.WriteLine("Hey there! I am Dodger! Nice to meet you!");
                newAfrican.africanJumping();
            }
            else if (choice == 4)
            {
                RussianRobot newRussian = new RussianRobot("Charlie", "Toshiba", 100);
                Console.WriteLine("HEY YOU THERE! I'm Charlie! Nice to meet you!");
                newRussian.russianWaving();
            }
            else if (choice == 5)
            {
                Console.WriteLine("Thank you for your time! Have a good day!");
            }
            else
            {
                Console.WriteLine("Sorry I don't recognize that command");
                MenuRobot();
            }
        }
        public int rechargeAbility(string RobotBrand, int RobotBatteryLevel)
        {
            robotBrand        = RobotBrand;
            robotBatteryLevel = RobotBatteryLevel;

            AmericanRobot newAmerican = new AmericanRobot("Daniel", "Apple", 100);
            JapaneseRobot newJapanese = new JapaneseRobot("Matthew", "Sony", 100);
            AfricanRobot  newAfrican  = new AfricanRobot("Rodney", "Samsung", 100);
            RussianRobot  newRussian  = new RussianRobot("Sean", "Toshiba", 100);

            int rechargedBatteryLevel = 100;

            List <Robot> rechargeFleet = new List <Robot>();

            rechargeFleet.Add(newAmerican);
            rechargeFleet.Add(newJapanese);
            rechargeFleet.Add(newAfrican);
            rechargeFleet.Add(newRussian);

            Console.WriteLine("Here is your fleet of Recharge Robots");
            Console.WriteLine("----------------------");
            Console.WriteLine(newAmerican.robotName);
            Console.WriteLine(newJapanese.robotName);
            Console.WriteLine(newAfrican.robotName);
            Console.WriteLine(newRussian.robotName);

            Console.WriteLine("Recharge fleet at your service!");



            if (batteryLevel == 100)
            {
                Console.WriteLine("Our services are not needed.");
            }
            else if (batteryLevel >= 41)
            {
                Console.WriteLine("Are you sure you need a recharge?");
                return(batteryLevel);
            }
            else if (batteryLevel <= 40)
            {
                Console.WriteLine("Time to recharge!");
                increaseBattery += batteryLevel;
                Console.WriteLine("Your battery level is " + rechargedBatteryLevel);
                return(rechargedBatteryLevel);
            }

            return(rechargedBatteryLevel);
        }