Esempio n. 1
0
        static void Main(string[] args)
        {
            //Create an interactive console window
            //Prompt user to choose what to do whith the fricge
            //Call methods on Fridge object to do what the useer wants
            int    userChoice;
            int    foodRemoved;
            Fridge userFridge = new Fridge(false, "deluxe", 70, true);

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change the lightbulb, type 2");
                Console.WriteLine("To clean, type 3");
                Console.WriteLine("To take food, type 4");
                Console.WriteLine("To check food supplies, type 5");
                Console.WriteLine("to see all fridge details, type 6");
                //Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());

                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food do you want to remove?");
                    foodRemoved = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(foodRemoved);
                    Console.WriteLine("Food Amount is: " + userFridge.FoodAmount);
                    break;

                case 5:
                    Console.WriteLine("Fridge is: " + userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine("User Details");
                    Console.WriteLine("Is Fridge Clean: " + userFridge.IsClean);
                    Console.WriteLine("Dispenser Type: " + userFridge.DispenserType);
                    Console.WriteLine("Food Amount: " + userFridge.FoodAmount);
                    Console.WriteLine("Bulbs Work: " + userFridge.BulbsWork);
                    break;
                }
                Console.WriteLine("");
            } while (userChoice != 8);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //create interactive console window
            //prompt user to choose what to do with the fridge
            //call methods on fridge object to do what the user wants
            int userChoice;

            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true); //this is outside of the loop, so that it doesnt keep resetting

            do                                                                   // starts the loop
            {
                Console.WriteLine("Hello, welcome to the fridge");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change the lightbulb type 2");
                Console.WriteLine("To clean, type 3");
                Console.WriteLine("To take food, type 4");
                Console.WriteLine("To check food supplies, type 5");
                Console.WriteLine("To  see all fridge details, type 6");
                //Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());



                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food has been removed?"); //taking in value
                    int amount = int.Parse(Console.ReadLine());           // declaring an int and parsing into the readline
                    userFridge.RemoveFood(amount);                        //now the userFridge (amount of food has been declared in int amount)
                    break;

                case 5:
                    Console.WriteLine(userFridge.FoodAmount);
                    break;

                case 6:
                    Console.WriteLine("you have " + userFridge.FoodAmount + " pounds of food in your fridge");
                    Console.WriteLine("The bulbs are working: " + userFridge.BulbsWork);
                    Console.WriteLine("Your dispenser type is :" + userFridge.DispenserType);
                    Console.WriteLine("Fridge is clean?:" + userFridge.IsClean);
                    break;
                }
            } while (userChoice != 8);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            //create an interactive console window
            //prompt user to chose what to do with the fridge
            //call methods on fridge object to so what user wants

            int    userChoice;
            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app. ");
                Console.WriteLine("What would you like to do with you fridge?");

                Console.WriteLine("To dispesense water, type 1");
                Console.WriteLine("To change lightbulb, type 2");
                Console.WriteLine("To clean, type 3");
                Console.WriteLine("to take food, type 4");
                Console.WriteLine("To check food supples, type 5");
                Console.WriteLine("To see all fridge detail, type 6");
                //Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());



                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food would you like to remove");
                    int removeFood = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(removeFood);
                    Console.WriteLine("your new new food level is: " + userFridge.FoodAmount);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine("your fridge detials is: " + userFridge.IsClean + "your fridge is clean" + userFridge.DispenserType +
                                      userFridge.FoodAmount + userFridge.BulbsWork + "you bulbs work");
                    break;
                }
            } while (userChoice != 8);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            //create an interactive console window
            //Prompt user to choose what to do with the fridge
            //Call methods on fridge object to do what the user wants
            int    userChoice;
            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1.");
                Console.WriteLine("To change the lightbulb, type 2.");
                Console.WriteLine("To clean, type 3.");
                Console.WriteLine("To take food, type 4.");
                Console.WriteLine("To check food supplies, type 5.");
                Console.WriteLine("To see all fridge details, type 6.");
                Console.WriteLine("To restart, type 7.");
                Console.WriteLine("To quit, type 8.");

                userChoice = int.Parse(Console.ReadLine());

                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("Enter the amount of food removed");
                    int amount = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(amount);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                default:
                    Console.WriteLine(" ");
                    Console.WriteLine(userFridge.Clean());
                    Console.WriteLine("Type of dispenser: " + userFridge.DispenserType);
                    Console.WriteLine("Remaining food amount: " + userFridge.FoodAmount);
                    Console.WriteLine("Bulbs: " + userFridge.BulbsWork);
                    break;
                }
            } while ((userChoice != 8) || (userChoice == 7));
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            //Create an interactive console window
            //Prompt user to choose what to with the fridge
            //Call mehods on Fride object to do what the user wants
            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);
            int    userChoice;

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change the lightbulb, type 2");
                Console.WriteLine("TO clean, type 3");
                Console.WriteLine("To take food, type 4.");
                Console.WriteLine("To check food supplies, type 5");
                Console.WriteLine("To see all fridge details, type 6");
                //Console.WriteLine("To resert type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());


                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();     //method type was void
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBubls());     //prints out the string...method type was string
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food do you want? Please enter a number of items.");
                    int usersFood = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(usersFood);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());     //displays to the console the method CheckSupplies
                    break;

                case 6:
                    Console.WriteLine(userFridge.DispenserType);
                    Console.WriteLine(userFridge.ChangeBubls());
                    Console.WriteLine(userFridge.Clean());
                    Console.WriteLine(userFridge.FoodAmount);
                    break;
                }
            } while (userChoice != 8);
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            // create an interactive console window
            // prompt usr what to do with th fridge
            // call methods on bridge object to do what the user wants

            int    userChoice;
            Fridge userFridge = new Fridge(false, "deluxe dispnser", 70, true);

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type, 1");
                Console.WriteLine("To change lightbulb, type 2");
                Console.WriteLine("To clean, type 3");
                Console.WriteLine("To take food type 4");
                Console.WriteLine("To check food supplies, type 5");
                Console.WriteLine("To see all fridge details, type 6");
                //Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                // give user the change to change the constructor, these are hard coded
                userChoice = int.Parse(Console.ReadLine());


                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How many units of food do you want to eat?");
                    int foodEaten = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(foodEaten);
                    //Console.WriteLine(userFridge.RemoveFood);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine("The fridge is clean " + userFridge.IsClean + ", the bulb is working, " + userFridge.BulbsWork + ", The food amount is " + userFridge.FoodAmount + ", The dispenser type is " + userFridge.DispenserType);
                    break;
                }
            } while (userChoice != 8);
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            // Create an interactive console window
            // Prompt user to choose what to do with the fridge
            // Call methods on fridge object to do what the user wants
            int    userChoice = 0;
            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true); // this has to be out of the loop otherwise it resets everytime

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1.");
                Console.WriteLine("To change the lightbulb, type 2.");
                Console.WriteLine("To clean, type 3.");
                Console.WriteLine("To take food, type 4.");
                Console.WriteLine("To check food supplies, type 5.");
                Console.WriteLine("To see all fridge details, type 6.");
                //Console.WriteLine("To restart, type 7.");
                Console.WriteLine("To quit, type 8.");

                userChoice = int.Parse(Console.ReadLine());
                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food do you want? Please enter number of items.");
                    int usersFood = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(usersFood);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:     // display all fridge details
                    Console.WriteLine("The dispenser type is " + userFridge.DispenserType);
                    Console.WriteLine("It is " + userFridge.BulbsWork + " that the bulbs work.");
                    Console.WriteLine("It is " + userFridge.IsClean + " that the fridge is clean.");
                    Console.WriteLine("The fridge has " + userFridge.FoodAmount + " food items.");
                    break;
                }
            } while (userChoice != 8);
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            //Want to create an interactive window
            //Prompt user to choose what to do with the fridge
            //Call methods on fridge object to do what user wants

            int userChoice;

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1.");
                Console.WriteLine("To change the lightbulb, type 2.");
                Console.WriteLine("To clean, type 3.");
                Console.WriteLine("To take food, type 4.");
                Console.WriteLine("To check supplies, type 5.");
                Console.WriteLine("To see all fridge details, type 6.");
                Console.WriteLine("To restart, type 7.");
                Console.WriteLine("To quit, type 8.");

                Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);
                userChoice = int.Parse(Console.ReadLine());
                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food are you removing?");
                    int foodRemoved = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(foodRemoved);
                    Console.WriteLine("Remaining food amount is " + userFridge.FoodAmount);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckFoodSupplies());
                    break;

                case 6:
                    Console.WriteLine("The fridge is clean: " + userFridge.IsClean);
                    Console.WriteLine("The type of dispenser: " + userFridge.DispenserType);
                    Console.WriteLine("The amount of foor remaining: " + userFridge.FoodAmount);
                    Console.WriteLine("Do the light bulbs work? " + userFridge.BulbsWork);
                    break;

                case 7:
                    break;

                case 8:
                    break;

                default:
                    Console.WriteLine("Please enter a valid number");
                    break;
                }
            } while ((userChoice != 8) || (userChoice == 7));
            if (userChoice == 8)
            {
                Console.WriteLine("You have quit the program.");
            }
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            // Create an interactive console window
            // Prompt user to choose what to do with the fridge
            // Call methods on Fridge object to do what the user wants

            int userChoice;

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1.");
                Console.WriteLine("To change light bulb, type 2.");
                Console.WriteLine("To clean, type 3.");
                Console.WriteLine("To take food, type 4.");
                Console.WriteLine("To check food supplies, type 5.");
                Console.WriteLine("To see all fridge details, type 6");
                //Console.WriteLine("To restart, type 7.");
                Console.WriteLine("To quit, type 8.");
                Console.WriteLine("");

                userChoice = int.Parse(Console.ReadLine());

                Fridge userFridge = new Fridge(false, "delux dispenser", 70, true); //(dispense water,            ,

                int foodRemoved = 0;

                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    userFridge.CheckSupplies();
                    //Console.WriteLine(userFridge.RemoveFood);
                    userFridge.RemoveFood(foodRemoved -= 70);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine(userFridge);
                    break;

                //case 7: ..................OPTIONAL TO PUT IN
                //    break;

                case 8:
                    Console.WriteLine("Thank you for using the fridge app.");
                    Console.ReadLine();
                    break;
                }
                Console.WriteLine("");
            } while (userChoice != 8);
        }
Esempio n. 10
0
        static void Main(string[] args)
        {
            //create an interactive console window
            //prompt user to choose what to do with the fridge
            //call methods on fridge object to do what the user wants

            int    userChoice;
            Fridge userFridge = new Fridge(false, "deluxe dispense", 70, true);

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change lightbulb, type 2");
                Console.WriteLine("To clean your fridge, type 3");
                Console.WriteLine("To take food from your fridge, type 4");
                Console.WriteLine("To check food supplies, type 5");
                Console.WriteLine("To see all fridge details, type 6");
                //  Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());



                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();     //void, console.writeline in method
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());     //returned a string, had to write value to console
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food would you like to remove? Please enter a number of items");
                    int usersFood = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(usersFood);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine("Your fridge has a  " + userFridge.DispenserType);
                    Console.WriteLine("Your fridge has a {0}.", userFridge.DispenserType);    //another way to display the value
                    Console.WriteLine("Your bulbs " + userFridge.ChangeBulbs());
                    Console.WriteLine("Your fridge is " + userFridge.Clean());
                    Console.WriteLine("You have " + userFridge.FoodAmount + "food.");
                    break;
                }
            } while (userChoice != 8);
            {
            }
        }
Esempio n. 11
0
        private static void Main()
        {
            // Create interactive console user
            // Prompt user to choose what to do with the
            // Call methods on fridge object to do what the user wants
            int userChoice;

            Console.WriteLine("Hello, welcome to the fridge app.");
            Fridge userFridge = new Fridge(false, "Deluxe dispenser", 70, true);

            do
            {
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1.");
                Console.WriteLine("To change the light bulb, type 2.");
                Console.WriteLine("To clean, type 3.");
                Console.WriteLine("To take food, type 4.");
                Console.WriteLine("To check food supplies, type 5.");
                Console.WriteLine("To see all fridge details, type 6.");
                //Console.WriteLine("To restart, type 7.");
                Console.WriteLine("To quit, type 8.");

                userChoice = int.Parse(Console.ReadLine());



                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:

                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("How much food do you want to remove, please type in amount?");
                    int foodNumber = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(foodNumber);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine("It is {0} that the fridge is clean. \nThe dispenser type is {1}. \nThe food amount is {2}. \nIt is {3} that the bulbs work.", userFridge.IsClean, userFridge.DispenserType, userFridge.FoodAmount, userFridge.BulbsWork);
                    Console.WriteLine();
                    break;

                default:
                    break;
                }
            } while (userChoice != 8); // Restart the app
        }
Esempio n. 12
0
        static void Main(string[] args)
        {
            //create interactive console windows
            //prompt user to choose what to do with the fridge
            //call methods on fridge object to do what the user wants
            int    userChoice;
            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);

            do
            {
                Console.WriteLine("");
                Console.WriteLine("Hello welcome to fridge app.");
                Console.WriteLine("what would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change the lightbulb,Type 2");
                Console.WriteLine("To clean ,type 3");
                Console.WriteLine("To take food,type 4");
                Console.WriteLine("To check food supplies,type 5");
                Console.WriteLine("To see all fridge details,type 6");
                Console.WriteLine("To restart,type 7");
                Console.WriteLine("To quit,type 8");

                userChoice = int.Parse(Console.ReadLine());

                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("Enter the amount of food removed");
                    int removedFood;
                    removedFood = int.Parse(Console.ReadLine());

                    userFridge.RemoveFood(removedFood);
                    Console.WriteLine("Remaing food" + userFridge.FoodAmount);
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    break;

                case 6:
                    Console.WriteLine("");
                    Console.WriteLine(userFridge.Clean());
                    Console.WriteLine("Type of dispenser: " + userFridge.DispenserType);
                    Console.WriteLine("Remaing food:  " + userFridge.FoodAmount);
                    Console.WriteLine("Bulb:  " + userFridge.BulbWork);
                    break;

                case 7:
                    break;

                case 8:
                    break;

                default:
                    Console.WriteLine("please enter valid number");
                    break;
                }
            } while((userChoice != 8) || (userChoice == 7));
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            //create an interactive console window
            //prompt user to choose what to do with the fridge
            //Call methods on fridge object to do what the user wants

            Fridge userFridge = new Fridge(70, "deluxe dispenser", false, true)

                                int userChoice;

            Console.WriteLine("Hello, welcome to the fridge app.");
            do
            {
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change the lightbulbs, type 2");
                Console.WriteLine("To clean, type 3");
                Console.WriteLine("To take food, type 4");
                Console.WriteLine("To check food supplies, type 5");
                Console.WriteLine("To see all fridge details, type 6");
                Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());



                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    Console.WriteLine("");
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    Console.WriteLine("");
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    Console.WriteLine("");
                    break;

                case 4:
                    Console.WriteLine("How much food do you want to remove? Please type a whole number");
                    int foodNumber = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(foodNumber);
                    Console.WriteLine("");
                    break;

                case 5:
                    Console.WriteLine(userFridge.CheckSupplies());
                    Console.WriteLine("");
                    break;

                case 6:
                    Console.WriteLine("It is {0} that the fridge is clean. \nThe water dispenser is a {1}. \nThe food amount is {2}. \nIt is {3} that the blulbs work.", userFridge.IsClean, userFridge.DispenserType, userFridge.FoodAmount, userFridge.BulbsWork);
                    Console.WriteLine("\n");
                    break;
                }
            } while (userChoice != 8);
            Console.WriteLine("\nThank you for using the Fridge App. Have a great day.");
        }
Esempio n. 14
0
        static void Main(string[] args)
        {
            //Create an interactive console window
            //Prompt user what to do with the fridge
            //Call methods on Fridge object to do what the user wants
            int userChoice;

            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);

            do
            {
                Console.WriteLine(" ");
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change lightbulb, type 2");
                Console.WriteLine("To clean type 3");
                Console.WriteLine("To take food, type 4");
                Console.WriteLine("To check supplies, type 5");
                Console.WriteLine("To see all fridge details, type 6");
                //Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8.");

                userChoice = int.Parse(Console.ReadLine());


                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    string bulbString = userFridge.ChangeBulbs();
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    Console.WriteLine(userFridge.Clean());
                    break;

                case 4:
                    Console.WriteLine("Here is the current food level:" + userFridge.FoodAmount);
                    Console.WriteLine("How much foor do you want to remove? Whole numbers only, between 1-80");
                    int foodRemove = int.Parse(Console.ReadLine());
                    userFridge.RemoveFood(foodRemove);
                    Console.WriteLine("Here is the current food level:" + userFridge.FoodAmount);
                    break;

                case 5:
                    Console.WriteLine("Here is the current food level:" + userFridge.FoodAmount);
                    break;

                case 6:
                    Console.WriteLine("Your Current Status:");
                    Console.WriteLine("Your dispenser is: " + userFridge.DispenserType + ", Fridge is clean: " + userFridge.IsClean + ", Your Food levels are: " + userFridge.FoodAmount + ", your bulbs are: " + userFridge.BulbsWork + ".");
                    break;

                default:
                    break;
                }
            } while (userChoice != 8);
        }
Esempio n. 15
0
        static void Main(string[] args)
        {
            //Create an interactive console window
            //Promt user to chose what to do with the fridge
            //Call methods on Fridge object to do what the user wants
            int    userChoice;
            Fridge userFridge = new Fridge(false, "deluxe dispenser", 70, true);

            do
            {
                Console.WriteLine("Hello, welcome to the fridge app.");
                Console.WriteLine("What would you like to do with your fridge?");
                Console.WriteLine("To dispense water, type 1");
                Console.WriteLine("To change the lightbulb, type 2");
                Console.WriteLine("To clean, type 3");
                Console.WriteLine("To take food, type 4");
                Console.WriteLine("To check supplies, type 5");
                Console.WriteLine("To see all fridge details, type 6");
                //Console.WriteLine("To restart, type 7");
                Console.WriteLine("To quit, type 8");

                userChoice = int.Parse(Console.ReadLine());



                int foodRemoved = 0;
                switch (userChoice)
                {
                case 1:
                    userFridge.DispenseWater();
                    break;

                case 2:
                    Console.WriteLine(userFridge.ChangeBulbs());
                    break;

                case 3:
                    userFridge.Clean();
                    Console.WriteLine(userFridge.IsClean);
                    break;

                case 4:
                    userFridge.CheckSupplies();
                    userFridge.RemoveFood(foodRemoved -= 70);
                    Console.WriteLine("Please choose how much food you would like");
                    Console.ReadLine();
                    break;

                case 5:

                    Console.WriteLine(userFridge.FoodAmount);
                    break;

                case 6:
                    Console.WriteLine(userFridge);
                    break;

                //case 7: Optional
                //break;

                case 8:
                    Console.WriteLine("Thank you for useing the fridge app!");
                    Console.ReadLine();
                    break;
                }
                Console.WriteLine("");
            } while (userChoice != 8);
        }