Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Boolean appRunState = true; //application run state control variable


            //string checkForExit = "null"; TBR

            //instantiate objects

            VirtualPetShelter myShelter    = new VirtualPetShelter();
            Volunteer         volunteerOne = new Volunteer();
            Manager           managerOne   = new Manager();
            Pet petOne   = new Pet();
            Pet petTwo   = new Pet();
            Pet petThree = new Pet();
            Pet petFour  = new Pet();

            // set names and values.

            petOne.Name      = "abbey";
            petOne.TypeOfPet = "Cat";
            petOne.Hunger    = 10;
            petOne.Thirst    = 10;
            petOne.Boredom   = 10;

            petTwo.Name      = "boston";
            petTwo.TypeOfPet = "Cat";
            petTwo.Hunger    = 20;
            petTwo.Thirst    = 20;
            petTwo.Boredom   = 20;

            petThree.Name      = "charlie";
            petThree.TypeOfPet = "Dog";
            petThree.Hunger    = 30;
            petThree.Thirst    = 30;
            petThree.Boredom   = 30;

            petFour.Name      = "dino";
            petFour.TypeOfPet = "Dog";
            petFour.Hunger    = 40;
            petFour.Thirst    = 40;
            petFour.Boredom   = 40;



            do
            {   //begin run state loop
                int menuSelection    = 0;
                int subMenuSelection = 0;



                // display UI


                do
                {
                    Console.WriteLine();
                    Console.WriteLine("Welcome to Vitual Pet Shelter. What employee type are you?");
                    Console.WriteLine();
                    Console.WriteLine("[1] Manager");
                    Console.WriteLine();
                    Console.WriteLine("[2] Volunteer");
                    Console.WriteLine();

                    //get resposnse menu response
                    menuSelection = int.Parse(Console.ReadLine());
                } while ((menuSelection < 1) || (menuSelection > 2)); //trap for invalid entry
                                                                      //process selection
                if (menuSelection == 1)                               // display manager sub menu
                {
                    Console.WriteLine("Thank you for working at Virtual Pet Shelter!");
                    Console.WriteLine();
                    //display pet status
                    Console.WriteLine();
                    Console.WriteLine(" This is the status of your pets...");
                    Console.WriteLine();
                    Console.WriteLine("Name | Hunger | Thirst| Boredom");
                    Console.WriteLine("-------------------------------");
                    Console.WriteLine(petOne.Name + "   " + petOne.Hunger + "         " + petOne.Thirst + "         " + petOne.Boredom);
                    Console.WriteLine(petTwo.Name + "     " + petTwo.Hunger + "       " + petTwo.Thirst + "         " + petTwo.Boredom);
                    Console.WriteLine(petThree.Name + "    " + petThree.Hunger + "       " + petThree.Thirst + "         " + petThree.Boredom);
                    Console.WriteLine(petFour.Name + "    " + petFour.Hunger + "         " + petFour.Thirst + "         " + petFour.Boredom);
                    Console.WriteLine();
                    Console.WriteLine("What would you like to do?");
                    Console.WriteLine();
                    Console.WriteLine("[1] Adopt a pet");
                    Console.WriteLine();
                    Console.WriteLine("[2] Feed the pets");
                    Console.WriteLine();
                    Console.WriteLine("[3] Water the pets");
                    Console.WriteLine();
                    Console.WriteLine("[4] Play with a pet");
                    Console.WriteLine();
                    Console.WriteLine("[5] Pay the bills");
                    Console.WriteLine();
                    Console.WriteLine("[6] Quit");
                    Console.WriteLine();
                    // get response
                    subMenuSelection = int.Parse(Console.ReadLine());

                    if (subMenuSelection == 2)
                    {   //change values
                        petOne.Hunger--;
                        petTwo.Hunger--;
                        petThree.Hunger--;
                        petFour.Hunger--;

                        //display menues

                        Console.WriteLine("Thank you for working at Virtual Pet Shelter!");
                        Console.WriteLine();
                        //display pet status
                        Console.WriteLine();
                        Console.WriteLine(" This is the status of your pets...");
                        Console.WriteLine();
                        Console.WriteLine("Name | Hunger | Thirst| Boredom");
                        Console.WriteLine("-------------------------------");
                        Console.WriteLine(petOne.Name + "  " + petOne.Hunger + "  " + petOne.Thirst + "  " + petOne.Boredom);
                        Console.WriteLine(petTwo.Name + "    " + petTwo.Hunger + "       " + petTwo.Thirst + "  " + petTwo.Boredom);
                        Console.WriteLine(petThree.Name + "  " + petThree.Hunger + "  " + petThree.Thirst + "  " + petThree.Boredom);
                        Console.WriteLine(petFour.Name + "  " + petFour.Hunger + "  " + petFour.Thirst + "  " + petFour.Boredom);
                        Console.WriteLine();
                        Console.WriteLine("What would you like to do?");
                        Console.WriteLine();
                        Console.WriteLine("[1] Adopt a pet");
                        Console.WriteLine();
                        Console.WriteLine("[2] Feed the pets");
                        Console.WriteLine();
                        Console.WriteLine("[3] Water the pets");
                        Console.WriteLine();
                        Console.WriteLine("[4] Play with a pet");
                        Console.WriteLine();
                        Console.WriteLine("[5] Pay the bills");
                        Console.WriteLine();
                        Console.WriteLine("[6] Quit");
                        Console.WriteLine();
                        // get response
                        subMenuSelection = int.Parse(Console.ReadLine());
                    }

                    if (subMenuSelection == 3)
                    {
                        //change values
                        petOne.Thirst--;
                        petTwo.Thirst--;
                        petThree.Thirst--;
                        petFour.Thirst--;

                        //display menu
                        Console.WriteLine("Thank you for working at Virtual Pet Shelter!");
                        Console.WriteLine();
                        //display pet status
                        Console.WriteLine();
                        Console.WriteLine(" This is the status of your pets...");
                        Console.WriteLine();
                        Console.WriteLine("Name | Hunger | Thirst| Boredom");
                        Console.WriteLine("-------------------------------");
                        Console.WriteLine(petOne.Name + "    " + petOne.Hunger + "       " + petOne.Thirst + "       " + petOne.Boredom);
                        Console.WriteLine(petTwo.Name + "    " + petTwo.Hunger + "       " + petTwo.Thirst + "       " + petTwo.Boredom);
                        Console.WriteLine(petThree.Name + "    " + petThree.Hunger + "       " + petThree.Thirst + "       " + petThree.Boredom);
                        Console.WriteLine(petFour.Name + "    " + petFour.Hunger + "       " + petFour.Thirst + "       " + petFour.Boredom);
                        Console.WriteLine();
                        Console.WriteLine("What would you like to do?");
                        Console.WriteLine();
                        Console.WriteLine("[1] Adopt a pet");
                        Console.WriteLine();
                        Console.WriteLine("[2] Feed the pets");
                        Console.WriteLine();
                        Console.WriteLine("[3] Water the pets");
                        Console.WriteLine();
                        Console.WriteLine("[4] Play with a pet");
                        Console.WriteLine();
                        Console.WriteLine("[5] Pay the bills");
                        Console.WriteLine();
                        Console.WriteLine("[6] Quit");
                        Console.WriteLine();
                        // get response
                        subMenuSelection = int.Parse(Console.ReadLine());
                    }
                    if (subMenuSelection == 4)
                    {
                        petOne.Boredom--;
                        petTwo.Boredom--;
                        petThree.Boredom--;
                        petFour.Boredom--;

                        Console.WriteLine("Thank you for working at Virtual Pet Shelter!");
                        Console.WriteLine();
                        //display pet status
                        Console.WriteLine();
                        Console.WriteLine(" This is the status of your pets...");
                        Console.WriteLine();
                        Console.WriteLine("Name | Hunger | Thirst| Boredom");
                        Console.WriteLine("-------------------------------");
                        Console.WriteLine(petOne.Name + "    " + petOne.Hunger + "       " + petOne.Thirst + "       " + petOne.Boredom);
                        Console.WriteLine(petTwo.Name + "    " + petTwo.Hunger + "       " + petTwo.Thirst + "       " + petTwo.Boredom);
                        Console.WriteLine(petThree.Name + "    " + petThree.Hunger + "       " + petThree.Thirst + "       " + petThree.Boredom);
                        Console.WriteLine(petFour.Name + "    " + petFour.Hunger + "       " + petFour.Thirst + "       " + petFour.Boredom);
                        Console.WriteLine();
                        Console.WriteLine("What would you like to do?");
                        Console.WriteLine();
                        Console.WriteLine("[1] Adopt a pet");
                        Console.WriteLine();
                        Console.WriteLine("[2] Feed the pets");
                        Console.WriteLine();
                        Console.WriteLine("[3] Water the pets");
                        Console.WriteLine();
                        Console.WriteLine("[4] Play with a pet");
                        Console.WriteLine();
                        Console.WriteLine("[5] Pay the bills");
                        Console.WriteLine();
                        Console.WriteLine("[6] Quit");
                        Console.WriteLine();
                        // get response
                        subMenuSelection = int.Parse(Console.ReadLine());
                    }

                    if (subMenuSelection == 5)
                    {
                        managerOne.PayTheBills();
                    }

                    if (subMenuSelection == 6)
                    {
                        appRunState = false; //exit program
                    }
                }

                if (menuSelection == 2) // display volunteer sub menu
                {
                    Console.WriteLine("Thank you for volunteering at Virtual Pet Shelter!");
                    Console.WriteLine();


                    // Display pet status ///maybe call Prop/Meth


                    Console.WriteLine("What would you like to do next?");
                    Console.WriteLine();
                    Console.WriteLine("[1] Feed the pets");
                    Console.WriteLine();
                    Console.WriteLine("[2] Water the pets");
                    Console.WriteLine();
                    Console.WriteLine("[3] Play with a pet");
                    Console.WriteLine();
                    Console.WriteLine("[4] Quit");
                    Console.WriteLine();

                    // get response
                    subMenuSelection = int.Parse(Console.ReadLine());
                    if (subMenuSelection == 4)
                    {
                        appRunState = false; //exit program
                    }
                }



                //if (subMenuSelection == 4)
                // {
                //     appRunState = false; //exit program

                //  }


                //// NO CODE BELOW HERE DANGER //// NO CODE BELOW HERE DANGER //// NO CODE BELOW HERE DANGER ///
            } while (appRunState); //app run state loop
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //Instantiate new shelter & new virtual pets
            VirtualPetShelter shelter = new VirtualPetShelter();
            VirtualPet        fidget  = new VirtualPet("Fidget", "mini-moo", 67, 22, 54);
            VirtualPet        tito    = new VirtualPet("Tito  ", "minotaur", 73, 45, 87);
            VirtualPet        pinky   = new VirtualPet("Pinky ", "unicorn", 79, 68, 94);

            // add pets to list
            shelter.AddPet(tito);
            shelter.AddPet(fidget);
            shelter.AddPet(pinky);
            List <VirtualPet> pets = shelter.GetPet();

            //volunteer options
            Console.WriteLine("Hello! Welcome to the Virtual Pet Shelter. Type 1 for manager or 2 for volunteer");
            int userSel = int.Parse(Console.ReadLine());

            if (userSel == 2)
            {
                Console.WriteLine("Thanks for coming in to volunteer today");
                Volunteer sign = new Volunteer();
                Console.WriteLine(sign.CheckIn());
                Console.WriteLine("Current Pet Status");
                Console.WriteLine(" ");

                Console.WriteLine("Name       |Hunger    |Thirst   |Boredom");
                Console.WriteLine("____________________________________________");

                // print out table with status
                foreach (VirtualPet pet in pets)
                {
                    Console.WriteLine(pet.Name + "     | " + pet.Hunger + "       | " + pet.Water + "      | " + pet.Play);
                    Console.WriteLine(" ");
                }
                Console.WriteLine("Type yes if you would like to take care of the pets now");
                string userAns = Console.ReadLine().ToLower();

                while (userAns.Equals("yes"))
                {
                    Console.WriteLine("What do you want to do?");
                    Console.WriteLine("");
                    Console.WriteLine("1 Feed the Pets");
                    Console.WriteLine("2 Water the Pets");
                    Console.WriteLine("3 Play with the Pets");
                    Console.WriteLine("4 Quit");
                    int userResp = int.Parse(Console.ReadLine());

                    switch (userResp)
                    {
                    case 1:
                        Volunteer hungry = new Volunteer();
                        hungry.Feed();
                        Console.WriteLine("The pets have been fed.");
                        break;

                    case 2:
                        Volunteer thirsty = new Volunteer();
                        thirsty.Thirst();
                        Console.WriteLine("The pets have been watered");
                        break;

                    case 3:
                        Volunteer fetch = new Volunteer();
                        fetch.Activity();
                        Console.WriteLine("Which pet would you like to play with?");
                        foreach (VirtualPet pet in pets)
                        {
                            Console.WriteLine(pet.Name);
                        }
                        string choice = Console.ReadLine().ToLower();
                        Console.WriteLine("You have played with  " + choice);
                        break;

                    case 4:
                        userAns = "test";
                        break;

                    default:
                        break;
                    }
                }
            }

            //manager options
            if (userSel == 1)
            {
                // print out table with status
                Console.WriteLine("Current Pet Status");
                Console.WriteLine(" ");
                Console.WriteLine("Name       |Hunger    |Thirst   |Boredom");
                Console.WriteLine("____________________________________________");

                foreach (VirtualPet pet in pets)
                {
                    Console.WriteLine(pet.Name + "     | " + pet.Hunger + "       | " + pet.Water + "      | " + pet.Play);
                    Console.WriteLine(" ");
                }
                Console.WriteLine("Type yes to do some work");
                string userAns = Console.ReadLine().ToLower();

                while (userAns.Equals("yes"))
                {
                    Console.WriteLine("");
                    Console.WriteLine("1 Play with the Pets");
                    Console.WriteLine("2 Adopt out a Pet");
                    Console.WriteLine("3 Sign in");
                    Console.WriteLine("4 Quit");
                    int userResp = int.Parse(Console.ReadLine());

                    switch (userResp)
                    {
                    case 1:
                        Console.WriteLine("Which pet would you like to play with?");
                        foreach (VirtualPet pet in pets)
                        {
                            Console.WriteLine(pet.Name);
                        }
                        string choice = Console.ReadLine().ToLower();
                        Console.WriteLine("You have played with  " + choice);
                        break;

                    case 2:
                        Console.WriteLine("Which pet is going to be adopted?");
                        foreach (VirtualPet pet in pets)
                        {
                            Console.WriteLine(pet.Name + "      " + pet.Description);
                        }
                        string  adoptee = Console.ReadLine().ToLower();
                        Manager newHome = new Manager();
                        Console.WriteLine(newHome.Adopt());
                        break;

                    case 3:
                        Manager swipe = new Manager();
                        Console.WriteLine(swipe.CheckIn());
                        break;

                    case 4:
                        userAns = "test";
                        break;
                    }
                }

                Console.WriteLine("Quit");
            }
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            // Define local variables for UI

            string volunteerMenu = "";
            string managerMenu   = "";
            string petToPlay;
            string adoptChoice = "";

            // Calls method to populates the initial pet statuses based on starting values from VirtualPet

            VirtualPet.InitialStatus();

            // UI STARTS HERE

            // While loop/start program

            Console.WriteLine("Welcome to the pet shelter! Please type Start to begin.");
            Console.Write("> ");
            string userResponse = Console.ReadLine().ToLower();

            while (userResponse.Equals("start"))
            {
                // Initial start while loop/prompt

                Console.WriteLine("Enter 1 if you're a volunteer or 2 if you're a manager.");
                Console.Write("> ");
                string roleResponse = Console.ReadLine().ToLower();
                while (roleResponse.Equals("1"))
                {
                    // Shows status of pets. Names come from VirtualPet class, others from VirtualPetShelter

                    string pet0Status = $"{VirtualPet.petList[0]}: Thirst: {VirtualPetShelter.thirstList[0]} Hunger: {VirtualPetShelter.hungerList[0]} Boredom: {VirtualPetShelter.boredList[0]} Adopted: {VirtualPetShelter.adoptedList[0]}";
                    string pet1Status = $"{VirtualPet.petList[1]}: Thirst: {VirtualPetShelter.thirstList[1]} Hunger: {VirtualPetShelter.hungerList[1]} Boredom: {VirtualPetShelter.boredList[1]} Adopted: {VirtualPetShelter.adoptedList[1]}";
                    string pet2Status = $"{VirtualPet.petList[2]}: Thirst: {VirtualPetShelter.thirstList[2]} Hunger: {VirtualPetShelter.hungerList[2]} Boredom: {VirtualPetShelter.boredList[2]} Adopted: {VirtualPetShelter.adoptedList[2]}";


                    Console.WriteLine("* Pet Shelter Volunteer Dashboard *");
                    Console.WriteLine("Current status of today's pets:");

                    // OutputStatus();

                    Console.WriteLine(pet0Status);
                    Console.WriteLine(pet1Status);
                    Console.WriteLine(pet2Status);

                    Console.WriteLine();
                    Console.WriteLine("What would you like to do?");
                    Console.WriteLine("Enter 1 to water all the pets.");
                    Console.WriteLine("Enter 2 to feed all the pets.");
                    Console.WriteLine("Enter 3 to play with a specific pet.");
                    Console.WriteLine("Enter 4 to have your ID checked.");
                    Console.WriteLine("Enter 5 to quit.");
                    volunteerMenu = (Console.ReadLine());

                    if (volunteerMenu.Equals("4"))
                    {
                        Volunteer tina = new Volunteer();
                        tina.CheckID();
                    }

                    if (volunteerMenu.Equals("1"))
                    {
                        Volunteer.WaterAllPets(); // Method call to water all the pets
                        Console.WriteLine("All the pets are hydrated!");
                    }

                    if (volunteerMenu.Equals("2"))
                    {
                        Volunteer.FeedAllPets(); // Method call to feed all the pets
                        Console.WriteLine("All the pets have been fed!");
                    }

                    if (volunteerMenu.Equals("3")) // Play with an individual pet
                    {
                        Console.WriteLine("Which pet would you like to play with?");
                        Console.Write("Enter 1 for {0}, 2 for {1} or 3 for {2}. > ", VirtualPet.petList[0], VirtualPet.petList[1], VirtualPet.petList[2]);
                        petToPlay = (Console.ReadLine());

                        if (petToPlay.Equals("1"))
                        {
                            Console.WriteLine("You played with {0}!", VirtualPet.petList[0]);
                            VirtualPetShelter.boredList[0] = 0;
                        }

                        if (petToPlay.Equals("2"))
                        {
                            Console.WriteLine("You played with {0}!", VirtualPet.petList[1]);
                            VirtualPetShelter.boredList[1] = 0;
                        }

                        if (petToPlay.Equals("3"))
                        {
                            Console.WriteLine("You played with {0}!", VirtualPet.petList[2]);
                            VirtualPetShelter.boredList[2] = 0;
                        }
                    }

                    if (volunteerMenu.Equals("5"))
                    {
                        Console.WriteLine("Thanks again for volunteering. Have a great day!");
                        return;
                    }
                }

                while (roleResponse.Equals("2"))
                {
                    Console.WriteLine("* Pet Shelter Management Dashboard *");
                    Console.WriteLine();
                    Console.WriteLine("What would you like to do?");
                    Console.WriteLine("Enter 1 to view the status of all pets.");
                    Console.WriteLine("Enter 2 to adopt pets.");
                    Console.WriteLine("Enter 3 to check ID.");
                    Console.WriteLine("Enter 4 to quit.");
                    Console.Write("> ");
                    managerMenu = (Console.ReadLine());

                    if (managerMenu.Equals("1"))
                    {
                        void OutputStatus() // Sets strings and outputs pet status. Wanted to reuse these but ran into problems getting them not to show every time.
                        {
                            string pet0Status = $"{VirtualPet.petList[0]}: Thirst: {VirtualPetShelter.thirstList[0]} Hunger: {VirtualPetShelter.hungerList[0]} Boredom: {VirtualPetShelter.boredList[0]} Adopted: {VirtualPetShelter.adoptedList[0]}";
                            string pet1Status = $"{VirtualPet.petList[1]}: Thirst: {VirtualPetShelter.thirstList[1]} Hunger: {VirtualPetShelter.hungerList[1]} Boredom: {VirtualPetShelter.boredList[1]} Adopted: {VirtualPetShelter.adoptedList[1]}";
                            string pet2Status = $"{VirtualPet.petList[2]}: Thirst: {VirtualPetShelter.thirstList[2]} Hunger: {VirtualPetShelter.hungerList[2]} Boredom: {VirtualPetShelter.boredList[2]} Adopted: {VirtualPetShelter.adoptedList[2]}";

                            Console.WriteLine(pet0Status);
                            Console.WriteLine(pet1Status);
                            Console.WriteLine(pet2Status);
                        }

                        OutputStatus(); // Built this with idea of trying to use for both managers and volunteers but had to shuffle after adding manager functions
                    }



                    if (managerMenu.Equals("3"))
                    {
                        Manager ted = new Manager();
                        ted.CheckID();
                    }



                    if (managerMenu.Equals("2"))
                    {
                        Console.WriteLine("We have the following pets today:");
                        Console.WriteLine();
                        Console.WriteLine("1: {0} is a {1} who {2} and lives off a diet of {3}.", VirtualPet.petList[0], VirtualPetDetails.petTypeList[0], VirtualPet.petDescriptList[0], VirtualPetDetails.petFoodList[0]);
                        Console.WriteLine("2: {0} is a {1} who {2} and lives off a diet of {3}.", VirtualPet.petList[1], VirtualPetDetails.petTypeList[1], VirtualPet.petDescriptList[1], VirtualPetDetails.petFoodList[1]);
                        Console.WriteLine("3: {0} is a {1} who {2} and lives off a diet of {3}.", VirtualPet.petList[2], VirtualPetDetails.petTypeList[2], VirtualPet.petDescriptList[2], VirtualPetDetails.petFoodList[2]);
                        Console.WriteLine("Which pet is the client most interested in? Enter 1, 2, or 3.");
                        Console.Write("> ");
                        adoptChoice = (Console.ReadLine());

                        // Options to place pets
                        if (adoptChoice.Equals("1"))
                        {
                            Console.WriteLine("You successfully placed {0}. Enjoy the rest of your day!", (VirtualPet.petList[0]));
                            Manager.AdoptPet0();     // Calls AdoptPet method in Manager class
                        }

                        if (adoptChoice.Equals("2"))
                        {
                            Console.WriteLine("You adopted out {0}. Nice work!", (VirtualPet.petList[0]));
                            Manager.AdoptPet1(); // Calls AdoptPet method in Manager class
                        }


                        if (adoptChoice.Equals("3"))
                        {
                            Console.WriteLine("You adopted {0}. Maybe it's time for a nap?", (VirtualPet.petList[2]));
                            Manager.AdoptPet2(); // Calls AdoptPet method in Manager class
                        }
                    }
                    if (managerMenu.Equals("4"))
                    {
                        Console.WriteLine("Have a great day!");
                        return;
                    }
                }
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            int    userChoice;
            string userInput;

            Volunteer  newVolunteer = new Volunteer();
            Manager    newManager   = new Manager();
            VirtualPet newDog       = new VirtualPet("Sirius", "Black dog who has human like intelligence.", 25, 22, 20);
            VirtualPet newCat       = new VirtualPet("Crookshanks", "Orange Cat who hates rats.", 50, 40, 92);
            VirtualPet newToad      = new VirtualPet("Trevor", "Green toad who often gets lost.", 20, 46, 76);
            VirtualPet newOwl       = new VirtualPet("Hedwig", "White owl who really likes mail.", 55, 83, 67);

            // fixed
            //newCat.Name = "Crookshanks ";
            //newDog.Name = "Sirius ";
            //newOwl.Name = "Hedwig ";
            //newToad.Name = "Trevor ";
            //newCat.Description = " Orange cat who hates rats.";
            //newDog.Description = " Black dog with human like intelligence.";
            //newToad.Description = " Green toad who gets lost easily.";
            //newOwl.Description = " White owl who really like mail.";


            Console.WriteLine("Welcome to the virtual pet shelter!");
            Console.WriteLine();


            // main menu

            Console.WriteLine("Please select an option from the following:");
            Console.WriteLine("Press 1 to clock in as volunteer.");
            Console.WriteLine("Press 2 to clock in as manager. ");
            Console.WriteLine("Press 0 to clock out");


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

                switch (userChoice)
                {
                case 1:
                {
                    Console.Clear();
                    newVolunteer.ClockIn();
                    Console.WriteLine("Thank you for volunteering!");
                    do
                    {
                        //volunteer menu
                        Console.WriteLine("Current pet values");
                        Console.WriteLine("| Name        | Hunger | Thirst   | Boredom |");
                        Console.WriteLine("| Sirius      | " + newDog.IsHungry + "     | " + newDog.IsThirsty + "       | " + newDog.IsBored + "      | ");
                        Console.WriteLine("| CrookShanks | " + newCat.IsHungry + "     | " + newCat.IsThirsty + "       | " + newCat.IsBored + "      | ");
                        Console.WriteLine("| Trevor      | " + newToad.IsHungry + "     | " + newToad.IsThirsty + "       | " + newToad.IsBored + "      | ");
                        Console.WriteLine("| Hedwig      | " + newOwl.IsHungry + "     | " + newOwl.IsThirsty + "       | " + newOwl.IsBored + "      | ");
                        Console.WriteLine();
                        Console.WriteLine("What volunteer task would you like to complete?");
                        Console.WriteLine("Enter 'play' to play with the pets.");
                        Console.WriteLine("Enter 'feed' to give the pets food.");
                        Console.WriteLine("Enter 'water' to give the pets water.");
                        Console.WriteLine("Enter 'leave' to clock out.");
                        Console.WriteLine();


                        userInput = Console.ReadLine().ToLower();

                        if (userInput == "play")
                        {
                            newVolunteer.Play();
                        }
                        if (userInput == "feed")
                        {
                            newCat.IsHungry--;
                            newDog.IsHungry--;
                            newOwl.IsHungry--;
                            newToad.IsHungry--;
                            newVolunteer.FeedPet();
                        }
                        if (userInput == "water")
                        {
                            newCat.IsThirsty--;
                            newDog.IsThirsty--;
                            newOwl.IsThirsty--;
                            newToad.IsThirsty--;
                            newVolunteer.WaterPet();
                        }
                    } while (userInput != "leave");
                    newVolunteer.ClockOut();
                } return;

                case 2:
                {
                    Console.Clear();
                    newManager.ClockIn();
                    Console.WriteLine();

                    do
                    {           //manager menu
                        Console.WriteLine("What manager task would you like to complete?");
                        Console.WriteLine("Enter 'adopt' to set up and adoption.");
                        Console.WriteLine("Enter 'play' to play with the pets.");
                        Console.WriteLine("Enter 'leave' to clock out.");
                        Console.WriteLine();

                        userInput = Console.ReadLine().ToLower();

                        // pet name and descriptions
                        if (userInput == "adopt")
                        {
                            Console.WriteLine();
                            Console.WriteLine("Here are the pets available for adoption.");
                            Console.WriteLine(newDog.Name + " is a " + newDog.Description);
                            Console.WriteLine(newCat.Name + " is an " + newCat.Description);
                            Console.WriteLine(newOwl.Name + " is a " + newOwl.Description);
                            Console.WriteLine(newToad.Name + " is a " + newToad.Description);
                            Console.WriteLine();
                            newManager.Adopt();
                        }
                        if (userInput == "play")
                        {
                            newManager.Play();
                        }
                    } while (userInput != "leave");
                    newManager.ClockOut();
                } return;
                }
            } while (userChoice != 0);
            newManager.ClockOut();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            List <string> names  = new List <string>();
            List <int>    hunger = new List <int>();
            List <int>    thirst = new List <int>();
            List <int>    energy = new List <int>();


            Random generator = new Random();
            int    hungerLevel;
            int    thirstLevel;
            int    energyLevel;
            int    userInput;
            int    employeeType;
            int    numberOfPets = 3;
            int    hoursWorked;
            int    characteristic;
            bool   petAdoption = false;
            bool   check       = false;
            string petNames;


            Manager               owner      = new Manager();
            Volunteer             collegeKid = new Volunteer();
            AnimalCharacteristics typeNDiet  = new AnimalCharacteristics();


            Console.WriteLine("Hello, before we get your title.  Lets take a look at the shelter pets!\n");
            Console.WriteLine("Looks like a full house! all 3 cages are full. Enter the pets names:");

            for (int i = 0; i < numberOfPets; i++)
            {
                petNames = Console.ReadLine().ToLower();
                names.Add(petNames);

                hungerLevel = generator.Next(0, 100);
                thirstLevel = generator.Next(0, 100);
                energyLevel = generator.Next(0, 100);

                hunger.Add(hungerLevel);
                thirst.Add(thirstLevel);
                energy.Add(energyLevel);
            }

            Pet petOne   = new Pet(names[0], hunger[0], thirst[0], energy[0]);
            Pet petTwo   = new Pet(names[1], hunger[1], thirst[1], energy[1]);
            Pet petThree = new Pet(names[2], hunger[2], thirst[2], energy[2]);

            Console.WriteLine("Thank you! What type of employee are you?");
            Console.WriteLine("1. Volunteer\n2. Manager");
            employeeType = int.Parse(Console.ReadLine());

            do
            {
                Console.WriteLine("This is the status of your pets: ");
                Console.WriteLine(String.Format("|{0,8}|{1,8}|{2,8}|{3,8}|", "Name", "Hunger", "Thirst", "Energy"));

                petOne.PetStatus();
                petTwo.PetStatus();
                petThree.PetStatus();


                if (employeeType == 1)
                {
                    Console.WriteLine("\nWhat would you like to do next?");
                    Console.WriteLine("1. Feed ALL pets");
                    Console.WriteLine("2. Give ALL pets water");
                    Console.WriteLine("3. Play with one pet");
                    Console.WriteLine("4. Clock Out");

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

                    switch (userInput)
                    {
                    case 1:
                        petOne.FeedAdjust();
                        petTwo.FeedAdjust();
                        petThree.FeedAdjust();
                        collegeKid.Feed();

                        break;

                    case 2:

                        petOne.WaterAdjust();
                        petTwo.WaterAdjust();
                        petThree.WaterAdjust();
                        collegeKid.Water();

                        break;

                    case 3:
                        Console.WriteLine("Which pet would you like to play with? ");
                        for (int i = 0; i < numberOfPets; i++)
                        {
                            Console.WriteLine((i + 1) + ". " + names[i]);
                        }
                        userInput = int.Parse(Console.ReadLine());

                        switch (userInput)
                        {
                        case 1:
                            petOne.PlayAdjust();
                            break;

                        case 2:
                            petTwo.PlayAdjust();
                            break;

                        case 3:
                            petThree.PlayAdjust();
                            break;
                        }

                        break;

                    case 4:
                        Console.WriteLine("How many hours have you worked?");
                        hoursWorked = int.Parse(Console.ReadLine());
                        check       = collegeKid.ClockOut(hoursWorked);

                        break;
                    }
                }
                else if (employeeType == 2)
                {
                    Console.WriteLine("\nWhat would you like to do next?");
                    Console.WriteLine("1. Adopt a pet");
                    Console.WriteLine("2. Give one pet water");
                    Console.WriteLine("3. Feed one pet");
                    Console.WriteLine("4. Check inventory");
                    Console.WriteLine("5. Clock Out");


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

                    switch (userInput)
                    {
                    case 1:
                        Console.WriteLine("Which pet would you like to adopt? (Enter the number");

                        for (int i = 0; i < numberOfPets; i++)
                        {
                            Console.WriteLine((i + 1) + ". " + names[i]);
                        }
                        userInput = int.Parse(Console.ReadLine());

                        switch (userInput)
                        {
                        case 1:
                            petAdoption = owner.Adopt();
                            petOne.Name = "ADOPTED!";

                            break;

                        case 2:
                            petAdoption = owner.Adopt();
                            petTwo.Name = "ADOPTED!";

                            break;

                        case 3:
                            petAdoption   = owner.Adopt();
                            petThree.Name = "ADOPTED!";

                            break;
                        }
                        break;

                    case 2:

                        Console.WriteLine("Which pet would you like to give water? (Enter the number)");

                        for (int i = 0; i < numberOfPets; i++)
                        {
                            Console.WriteLine((i + 1) + ". " + names[i]);
                        }
                        userInput = int.Parse(Console.ReadLine());

                        switch (userInput)
                        {
                        case 1:
                            petOne.WaterAdjust();
                            break;

                        case 2:
                            petTwo.WaterAdjust();
                            break;

                        case 3:
                            petThree.WaterAdjust();
                            break;
                        }
                        break;

                    case 3:
                        Console.WriteLine("Which pet would you like to feed? (Enter the number)");
                        for (int i = 0; i < numberOfPets; i++)
                        {
                            Console.WriteLine((i + 1) + ". " + names[i]);
                        }
                        userInput = int.Parse(Console.ReadLine());

                        switch (userInput)
                        {
                        case 1:
                            petOne.FeedAdjust();
                            break;

                        case 2:
                            petTwo.FeedAdjust();
                            break;

                        case 3:
                            petThree.FeedAdjust();
                            break;
                        }
                        break;

                    case 4:

                        for (int i = 0; i < numberOfPets; i++)
                        {
                            characteristic = generator.Next(1, 5);
                            Console.WriteLine(names[i] + " the " + typeNDiet.PetType(characteristic) + ". Eats a strict diet of " + typeNDiet.PetDiet(characteristic));
                        }

                        break;

                    case 5:

                        Console.WriteLine("How many hours have you worked?");
                        hoursWorked = int.Parse(Console.ReadLine());
                        check       = owner.ClockOut(hoursWorked);
                        break;
                    }
                }
                else
                {
                    throw new ArgumentException("You did not enter a valid number");
                }
            } while (check == false);
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            //Local Variables
            string exitMainMenu = "no";
            int    userResponse;
            string exitExistingMenu = "no";

            //instantiate objects from PetDetails
            PetDetails dog    = new PetDetails("Dog", "Dog Food", "Nuno", 25, 5, 7);
            PetDetails cat    = new PetDetails("Cat", "Cat Food", "Lucy", 22, 4, 9);
            PetDetails bird   = new PetDetails("Bird", "Bird Food", "Tweety", 20, 3, 6);
            PetDetails turtle = new PetDetails("Turtle", "Turtle Food", "Maverick", 24, 6, 5);

            Manager   Manager1   = new Manager(0, true);
            Volunteer Volunteer1 = new Volunteer();

            Manager1.Dog    = dog;
            Manager1.Cat    = cat;
            Manager1.Bird   = bird;
            Manager1.Turtle = turtle;

            Volunteer1.Dog    = dog;
            Volunteer1.Cat    = cat;
            Volunteer1.Bird   = bird;
            Volunteer1.Turtle = turtle;


            //While loop for main menu
            Console.WriteLine("Welcome to the Seamus Hobans Pet Shop");
            while (exitMainMenu.Equals("no"))
            {
                Console.WriteLine("Are you a manager or an volunteer?");
                Console.WriteLine("Select 1 if your a manager");
                Console.WriteLine("Select 2 if your an volunteer");
                Console.WriteLine("Select 3 to exit");
                userResponse = int.Parse(Console.ReadLine());
                Console.Clear();
                exitExistingMenu = "no";

                if (userResponse == 1)
                {
                    Manager manager = new Manager(5, false);
                    Console.WriteLine("Thank you for being a great manager, do you want to:");
                    Console.WriteLine("Select 1 to feed the pets.");
                    Console.WriteLine("Select 2 to play with the pets.");
                    Console.WriteLine("Select 3 to pay the bills.");
                    Console.WriteLine("Select 4 to view status of the pet.");
                    Console.WriteLine("Select 5 to adaopt a pet.");
                    userResponse = int.Parse(Console.ReadLine());
                    Console.Clear();

                    //Creating Logic switch statment for manager doin thier 4 tasks
                    switch (userResponse)
                    {
                    case 1:
                        manager.Feed();
                        break;

                    case 2:
                        Manager1.Play();
                        break;

                    case 3:
                        manager.PayBills();
                        break;

                    case 4:
                        Manager1.ViewStatus();
                        break;

                    case 5:
                        Manager1.AdoptAPet();
                        break;

                    default:
                        Console.WriteLine("Thanks you for managing Semus Hobans Pet Store");
                        break;
                    }
                }
                else if (userResponse == 2)
                {
                    Volunteer volunteer = new Volunteer();
                    Console.WriteLine("Thank you for being a most needed volunteer, do you want to:");
                    Console.WriteLine("Select 1 to feed the pets.");
                    Console.WriteLine("Select 2 to play with the pets.");
                    Console.WriteLine("Select 3 to give water to the pets.");
                    Console.WriteLine("Select 4 to view status of the pets.");
                    userResponse = int.Parse(Console.ReadLine());
                    Console.Clear();

                    //Creating logic for volunteer to do thier 3 tasks
                    switch (userResponse)
                    {
                    case 1:
                        volunteer.Feed();
                        break;

                    case 2:
                        Volunteer1.Play();
                        break;

                    case 3:
                        volunteer.Water();
                        break;

                    case 4:
                        Volunteer1.ViewStatus();
                        break;

                    default:
                        Console.WriteLine("Thankyou for volunteering at Seamus Hobans Pet Shop");
                        break;
                    }
                }
                else if (userResponse == 3)
                {
                    Console.WriteLine("Thank you for coming to Seamus Hobans Pet Shop.");
                    exitMainMenu = "yes";
                    Console.Clear();
                }
                else
                {
                    Console.WriteLine("Please select a valid respone.");
                }
            }
        }
Exemplo n.º 7
0
        static void Main()
        {
            bool condition = true;
            int  input     = 0;
            var  manager   = new Manager();
            var  employee  = new Volunteer();

            while (condition == true)
            {
                Console.WriteLine("Welcome to Big Nekos Pet Extravaganza. What type of worker are you?");
                Console.WriteLine("Type 1 for manager");
                Console.WriteLine("Type 2 for volunteer");
                input = int.Parse(Console.ReadLine());
                if (input == 1 || input == 2)
                {
                    condition = false;
                }
                else
                {
                    Console.WriteLine("Please enter valid input");
                }
            }

            foreach (VpetBase pet in VirtualPetShelter.GetPetValues())
            {
                Console.WriteLine("Pet Name: {0} Pet Description: {1} ... ", pet.GetPetName, pet.GetPetDescription);
            }

            if (input == 1)
            {
                while (!condition)//while condition stays false run loop
                {
                    Console.WriteLine();
                    Console.WriteLine("What would you like to do next?");
                    Console.WriteLine("Type 1 to adopt a pet");
                    Console.WriteLine("Type 2 to walk the pets");
                    Console.WriteLine("Type 3 to play with pets");
                    Console.WriteLine("Type 4 to quit");

                    input = int.Parse(Console.ReadLine());
                    if (input > 0 && input < 5)
                    {
                        switch (input)
                        {
                        case 1:
                            manager.AdoptPet();
                            break;

                        case 2:
                            manager.WalkDog();
                            break;

                        case 3:
                            manager.PlayingPet();
                            break;

                        case 4:
                            condition = !condition;
                            break;
                        }
                    }
                    else
                    {
                        Console.WriteLine("please insert a valid number");
                    }
                }
            }

            else
            {
                while (!condition)//while condition stays false run loop
                {
                    Console.WriteLine();
                    Console.WriteLine("What would you like to do next?");
                    Console.WriteLine("Type 1 to feed the pets");
                    Console.WriteLine("Type 2 to water the pets");
                    Console.WriteLine("Type 3 to play with pets");
                    Console.WriteLine("Type 4 to walk the pets");
                    Console.WriteLine("Type 5 to quit");
                    input = int.Parse(Console.ReadLine());
                    if (input > 0 && input < 6)
                    {
                        switch (input)
                        {
                        case 1:
                            employee.feed();
                            break;

                        case 2:
                            employee.water();
                            break;

                        case 3:
                            employee.PlayingPet();
                            break;

                        case 4:
                            employee.WalkDog();
                            break;

                        case 5:
                            condition = !condition;
                            break;
                        }
                    }
                    else
                    {
                        Console.WriteLine("please insert a valid number");
                    }
                }
            }
            while (condition)
            {
                Console.WriteLine("Do you want to come back to work tommorow? Y or N");
                string finalAnswer = Console.ReadLine().ToUpper();
                if (finalAnswer == "Y")
                {
                    Main();
                }
                else if (finalAnswer == "N")
                {
                    return;
                }
                else
                {
                    Console.WriteLine("Please learn the alphabet before continuing your education");
                }
            }
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Manager   manOne   = new Manager("Bob");
            Volunteer vol      = new Volunteer();
            Volunteer volOne   = new Volunteer(30, "Tim");
            Volunteer volTwo   = new Volunteer(20, "Cody");
            Volunteer volThree = new Volunteer(15, "Bill");

            VirtualPet Cat      = new VirtualPet();
            VirtualPet catOne   = new VirtualPet(2, 30, 30, 30, "Mittens", "Young and Shy");
            VirtualPet catTwo   = new VirtualPet(13, 20, 20, 15, "Furball", "Old and Fat");
            VirtualPet catThree = new VirtualPet(7, 22, 43, 56, "Sir Pur-a-lot", "Mid-Aged and Average");

            manOne.EmployeeID   = 1111;
            volOne.EmployeeID   = 2222;
            volTwo.EmployeeID   = 3333;
            volThree.EmployeeID = 4444;


            //Main Menu

            int userChoice = 0;

            do
            {
                Console.WriteLine("Main Menu");
                Console.WriteLine();
                Console.WriteLine("Employee Type:");
                Console.WriteLine("Managers press 1.");
                Console.WriteLine("Volunteers press 2.");
                Console.WriteLine();
                Console.WriteLine("To exit press 3.");
                userChoice = int.Parse(Console.ReadLine());
                Console.WriteLine();
                if (userChoice == 1)
                {
                    do
                    {
                        Console.WriteLine();
                        Console.WriteLine("Manager menu:");
                        Console.WriteLine("To check Volunteer status press 1.");
                        Console.WriteLine("Clock in press 2.");
                        Console.WriteLine("Status of the pets press 3.");
                        Console.WriteLine("To start the adoption process press 4.");
                        Console.WriteLine("To go back to the main menu press 5.");
                        userChoice = int.Parse(Console.ReadLine());
                        switch (userChoice)
                        {
                        case 1:
                            Console.WriteLine("Employee information:");
                            Console.WriteLine("Name   ID   Hours");
                            Console.WriteLine("-------------------");
                            Console.WriteLine("{0}  {1}  {2}", volOne.VolunteerName, volOne.EmployeeID, volOne.HoursAvailable);
                            Console.WriteLine("{0}  {1}  {2}", volTwo.VolunteerName, volTwo.EmployeeID, volTwo.HoursAvailable);
                            Console.WriteLine("{0}  {1}  {2}", volThree.VolunteerName, volThree.EmployeeID, volThree.HoursAvailable);
                            Console.WriteLine();
                            Console.WriteLine("Press any key to continue.");
                            Console.ReadKey();
                            break;

                        case 2:
                            Console.WriteLine(manOne.ClockIn());
                            Console.WriteLine("Press any key to continue.");
                            Console.ReadKey();
                            break;

                        case 3:

                            Console.Clear();
                            Console.WriteLine("Name Hunger Thirst Age");
                            Console.WriteLine("-------------------------------");
                            Console.WriteLine("{0} {1} {2} {3}", catOne.Name, catOne.Hunger, catOne.Thirst, catOne.Age);
                            Console.WriteLine();
                            Console.WriteLine("{0} {1} {2} {3}", catTwo.Name, catTwo.Hunger, catTwo.Thirst, catTwo.Hunger, catTwo.Age);
                            Console.WriteLine();
                            Console.WriteLine("{0} {1} {2} {3}", catThree.Name, catThree.Hunger, catThree.Thirst, catThree.Hunger, catThree.Age);
                            Console.WriteLine();
                            Console.WriteLine("Press any key to continue.");
                            Console.ReadKey();
                            break;

                        case 4:
                            Console.Clear();
                            Console.WriteLine("Type the name of the pet which is getting adopted.");
                            Console.WriteLine();
                            Console.WriteLine("Available pets:");
                            Console.WriteLine("-------------------------------");
                            Console.WriteLine("{0}" + " is " + "{1}", catOne.Name, catOne.Description);
                            Console.WriteLine();
                            Console.WriteLine("{0}" + " is " + "{1}", catTwo.Name, catTwo.Description);
                            Console.WriteLine();
                            Console.WriteLine("{0}" + " is " + "{1}", catThree.Name, catThree.Description);
                            string adopterPet = Console.ReadLine().ToLower();
                            if (adopterPet == "mittens")
                            {
                                Console.WriteLine("Mittens has been adopted.");
                            }
                            else if (adopterPet == "furball")
                            {
                                Console.WriteLine("Furball has been adopted.");
                            }
                            else if (adopterPet == "sir Pur-a-lot")
                            {
                                Console.WriteLine("Sir Pur-a-lot has been adopted.");
                            }
                            Console.WriteLine("Press any key to continue.");
                            Console.ReadKey();
                            break;
                        }
                    } while (userChoice != 5);
                }
                else if (userChoice == 2)
                {
                    do
                    {
                        Console.Clear();

                        Console.WriteLine("Volunteer menu:");
                        Console.WriteLine("To clock in press 1.");
                        Console.WriteLine("To feed the pets press 2.");
                        Console.WriteLine("To give the pets water press 3.");
                        Console.WriteLine("To play with a pet press 4.");
                        Console.WriteLine("To exit and return to the main menu press 5.");
                        userChoice = int.Parse(Console.ReadLine());
                        switch (userChoice)
                        {
                        case 1:
                            Console.WriteLine(vol.ClockIn());
                            Console.WriteLine("Press a key to continue.");
                            Console.ReadKey();
                            break;

                        case 2:
                            catOne.Feed();
                            catTwo.Feed();
                            catThree.Feed();
                            Console.WriteLine(vol.FeedPets());
                            Console.WriteLine("Press a key to continue.");
                            Console.ReadKey();
                            break;

                        case 3:
                            catOne.GiveWater();
                            catTwo.GiveWater();
                            catThree.GiveWater();
                            Console.WriteLine(vol.WaterPets());
                            Console.WriteLine("Press a key to continue.");
                            Console.ReadKey();
                            break;

                        case 4:
                            Console.WriteLine("Type the name of the pet you want to play with.");
                            Console.WriteLine(catOne.Name);
                            Console.WriteLine(catTwo.Name);
                            Console.WriteLine(catThree.Name);
                            string playPet = Console.ReadLine().ToLower();
                            if (playPet == "mittens")
                            {
                                Console.WriteLine("You played with Mittens");
                            }
                            else if (playPet == "furball")
                            {
                                Console.WriteLine("You played with Furball");
                            }
                            else if (playPet == "Sir Pur-a-lot")
                            {
                                Console.WriteLine("You played with Sir Pur-a-lot");
                            }
                            Console.WriteLine("Press a key to continue.");
                            Console.ReadKey();
                            break;
                        }
                    } while (userChoice != 5);
                }
                else
                {
                    Console.WriteLine("Goodbye!");
                }
            } while (userChoice != 3);
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            VirtualPet Shoober = new VirtualPet("Shoober", "Chunky", 5, 5, 5);
            VirtualPet Nibbles = new VirtualPet("Nibbles", "Hyper", 5, 5, 5);
            VirtualPet Hubert  = new VirtualPet("Hubert", "Skinny", 5, 5, 5);


            Manager   Bob   = new Manager();
            Volunteer Becky = new Volunteer();

            Console.WriteLine("Welcome to Krang's Cavern! What employee type are you?");
            Console.WriteLine("1. Manager.");
            Console.WriteLine("2. Volunteer.");

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

            if (input == 1)
            {
                Console.WriteLine("Thanks for working for Krang's Cavern! What would you like to do?");
                Console.WriteLine("1. Scan ID.");
                Console.WriteLine("2. Clock in.");
                Console.WriteLine("3. Adopt out a pet.");
                Console.WriteLine("4. Inspire the volunteers.");
                int.Parse(Console.ReadLine());
                if (input == 1)
                {
                    Bob.ShowID();
                }
                else if (input == 2)
                {
                    Bob.ClockIn();
                }
                else if (input == 3)
                {
                    Bob.Adopt();
                }
                else if (input == 4)
                {
                    Bob.Inspire();
                }
                else
                {
                    return;
                }
            }
            else if (input == 2)
            {
                Console.WriteLine("Thanks for vulonteering at Krang's Cavern! What would you like to do?");
                Console.WriteLine(" ");
                Console.WriteLine("This is the status of your pets.");
                Console.WriteLine("Name |Description |Hunger |Thirst |Boredom");
                Console.WriteLine("-----|------------|-------|-------|-------");
                Console.WriteLine(" ");
                Console.WriteLine(" ");
                Console.WriteLine(" ");
                Console.WriteLine("1. Show ID.");
                Console.WriteLine("2. Clock in.");
                Console.WriteLine("3. Feed pets.");
                int.Parse(Console.ReadLine());
                if (input == 1)
                {
                    Becky.ShowID();
                }
                else if (input == 2)
                {
                    Becky.ClockIn();
                }
                else if (input == 3)
                {
                    Becky.Feed();
                }
                else
                {
                    return;
                }
            }
            else
            {
                return;
            }
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            Mogwai    mogwai1    = new Mogwai("Batch 1", "Paleo", "Gizmo", "Brown and White", 5, 4, 3);
            Mogwai    mogwai2    = new Mogwai("Batch 2", "South Beach", "Stripe", "Mahogany and White", 4, 5, 6);
            Mogwai    mogwai3    = new Mogwai("Batch 2", "Pescatarian", "Mohawk", "Black and White", 7, 2, 5);
            Volunteer volunteer1 = new Volunteer(1234, "Ringo");
            Volunteer volunteer2 = new Volunteer(1235, "George");
            Manager   manager1   = new Manager(1236, "John", 30000.00);


            int userChoice;


            do
            {
                Console.WriteLine("Welcome to the Mr. Wing's Pet Shelter!");
                Console.WriteLine("What employee type are you?");
                Console.WriteLine("Type 1 for Manager.");
                Console.WriteLine("Type 2 for Volunteer.");
                Console.WriteLine("Type 3 to Quit.");

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

                if (userChoice == 1)
                {
                    Console.WriteLine("Welcome, Manager");
                    do
                    {
                        Console.WriteLine("Mogwai: " + mogwai1.Name + " | " + mogwai2.Name + " | " + mogwai3.Name);
                        Console.WriteLine("Hunger (out of 10): " + mogwai1.HungerLevel + " | " + mogwai2.HungerLevel + " | " + mogwai3.HungerLevel);
                        Console.WriteLine("Thirst (out of 10): " + mogwai1.ThirstLevel + " | " + mogwai2.ThirstLevel + " | " + mogwai3.ThirstLevel);
                        Console.WriteLine("Boredom (out of 10): " + mogwai1.BoredomLevel + " | " + mogwai2.BoredomLevel + " | " + mogwai3.BoredomLevel);
                        Console.WriteLine("");
                        Console.WriteLine("What would you like to do for the mogwai?");
                        Console.WriteLine("Adopt mogwai, type 1");
                        Console.WriteLine("Feed mogwai, type 2");
                        Console.WriteLine("Play with the mogwai, type 3");
                        Console.WriteLine("To exit Manager sub-menu, type 4");

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

                        switch (userChoice)
                        {
                        case 1:
                            Console.WriteLine("Which mogwai would you like to adopt: " + mogwai1.Name + " (" + mogwai1.Description + "), " + mogwai2.Name + " (" + mogwai2.Description + "), or " + mogwai3.Name + " (" + mogwai3.Description + ")?");
                            string adoptee = Console.ReadLine();
                            Console.WriteLine(adoptee + " is an excellent choice.");
                            manager1.AdoptMogwai();
                            break;

                        case 2:
                            mogwai1.FedMogwai();
                            mogwai2.FedMogwai();
                            mogwai3.FedMogwai();
                            break;

                        case 3:
                            Console.WriteLine("Which mogwai do you wish to play with?");
                            Console.WriteLine("Type 1 for " + mogwai1.Name + ".");
                            Console.WriteLine("Type 2 for " + mogwai2.Name + ".");
                            Console.WriteLine("Type 3 for " + mogwai3.Name + ".");
                            int playmate = int.Parse(Console.ReadLine());
                            if (playmate == 1)
                            {
                                mogwai1.PlayedWithMogwai();
                                break;
                            }
                            if (playmate == 2)
                            {
                                mogwai2.PlayedWithMogwai();
                                break;
                            }
                            if (playmate == 3)
                            {
                                mogwai3.PlayedWithMogwai();
                                break;
                            }
                            else
                            {
                                break;
                            }

                        case 4:
                            Console.WriteLine("You have exited the Manager sub-menu.");
                            Console.WriteLine("");
                            break;
                        }

                        //tick
                        mogwai1.TickMethod();
                        mogwai2.TickMethod();
                        mogwai3.TickMethod();
                    } while (userChoice != 4);
                }
                if (userChoice == 2)
                {
                    Console.WriteLine("Welcome, Volunteer!");
                    do
                    {
                        Console.WriteLine("Mogwai: " + mogwai1.Name + " | " + mogwai2.Name + " | " + mogwai3.Name);
                        Console.WriteLine("Hunger (out of 10): " + mogwai1.HungerLevel + " | " + mogwai2.HungerLevel + " | " + mogwai3.HungerLevel);
                        Console.WriteLine("Thirst (out of 10): " + mogwai1.ThirstLevel + " | " + mogwai2.ThirstLevel + " | " + mogwai3.ThirstLevel);
                        Console.WriteLine("Boredom (out of 10): " + mogwai1.BoredomLevel + " | " + mogwai2.BoredomLevel + " | " + mogwai3.BoredomLevel);
                        Console.WriteLine("");
                        Console.WriteLine("What would you like to do for the mogwai?");
                        Console.WriteLine("Feed mogwai, type 1");
                        Console.WriteLine("Give the mogwai something to drink, type 2");
                        Console.WriteLine("Play with the mogwai, type 3");
                        Console.WriteLine("To exit Volunteer sub-menu, type 4");

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

                        switch (userChoice)
                        {
                        case 1:
                            volunteer1.FeedPets();
                            mogwai1.FedMogwai();
                            mogwai2.FedMogwai();
                            mogwai3.FedMogwai();
                            break;

                        case 2:
                            volunteer1.WaterPets();
                            mogwai1.WateredMogwai();
                            mogwai2.WateredMogwai();
                            mogwai3.WateredMogwai();
                            break;

                        case 3:
                            Console.WriteLine("Which mogwai do you wish to play with?");
                            Console.WriteLine("Type 1 for " + mogwai1.Name + ".");
                            Console.WriteLine("Type 2 for " + mogwai2.Name + ".");
                            Console.WriteLine("Type 3 for " + mogwai3.Name + ".");
                            int playmate = int.Parse(Console.ReadLine());
                            if (playmate == 1)
                            {
                                mogwai1.PlayedWithMogwai();
                                break;
                            }
                            if (playmate == 2)
                            {
                                mogwai2.PlayedWithMogwai();
                                break;
                            }
                            if (playmate == 3)
                            {
                                mogwai3.PlayedWithMogwai();
                                break;
                            }
                            else
                            {
                                break;
                            }

                        case 4:
                            Console.WriteLine("You have exited the Volunteer sub-menu.");
                            Console.WriteLine("");
                            break;
                        }

                        //tick
                        mogwai1.TickMethod();
                        mogwai2.TickMethod();
                        mogwai3.TickMethod();
                    } while (userChoice != 4);
                }
                else
                {
                    Console.WriteLine("Goodbye.");
                    break;
                }
            } while (userChoice != 3);
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            VirtualPetShelter vpshelter = new VirtualPetShelter();
            Manager           manager   = new Manager();
            Volunteer         volunteer = new Volunteer();

            vpshelter.Pets      = new List <VirtualPet>();
            vpshelter.Employees = new List <Employee>();

            Dog jack = new Dog("Jack", "Dog", 83, 34, 23);
            Dog john = new Dog("John", "Dog", 69, 49, 02);
            Cat paul = new Cat("Paul", "Cat", 39, 18, 88);
            Cat glen = new Cat("Glen", "Cat", 59, 19, 37);

            vpshelter.SetPets(vpshelter.Pets, jack);
            vpshelter.SetPets(vpshelter.Pets, john);
            vpshelter.SetPets(vpshelter.Pets, paul);
            vpshelter.SetPets(vpshelter.Pets, glen);

            Manager   courtney = new Manager("Courtney");
            Manager   pete     = new Manager("Pete");
            Volunteer heidi    = new Volunteer("Heidi");
            Volunteer mark     = new Volunteer("Mark");

            vpshelter.SetEmployees(vpshelter.Employees, courtney);
            vpshelter.SetEmployees(vpshelter.Employees, pete);
            vpshelter.SetEmployees(vpshelter.Employees, heidi);
            vpshelter.SetEmployees(vpshelter.Employees, mark);

            Console.WriteLine("Would you like to play Virtual Pet Shelter?");
            Console.WriteLine("1. Yes");
            Console.WriteLine("2. No");
            Console.WriteLine();

            Console.Write("> ");
            string userResp = Console.ReadLine();

            Console.Clear();

            while (userResp == "1") // Setting a Game Loop
            {
                Console.WriteLine("Welcome to Courtney's Virtual Pet Shelter. What employee type are you?");
                Console.WriteLine("1. Manager");
                Console.WriteLine("2. Volunteer");
                Console.WriteLine("3. Quit");
                Console.WriteLine();

                Console.Write("> ");
                string employeeResp = Console.ReadLine();

                Console.WriteLine("\nThank you for working at Courtney's Virtual Pet Shelter!\n");

                if (employeeResp == "3")
                {
                    Console.Clear();
                    userResp = "0";
                }

                while (employeeResp == "1") // Manager Menu
                {
                    Console.WriteLine("Which manager are you?");
                    Console.WriteLine("1. Courtney");
                    Console.WriteLine("2. Pete");
                    Console.WriteLine("3. Switch employee type");
                    Console.WriteLine("4. Quit");
                    Console.WriteLine();

                    Console.Write("> ");
                    string userMgr = Console.ReadLine();

                    if (userMgr == "3")
                    {
                        Console.Clear();
                        employeeResp = "0";
                    }
                    if (userMgr == "4")
                    {
                        Console.Clear();
                        employeeResp = "0";
                        userResp     = "2";
                    }

                    while (userMgr == "1" || userMgr == "2")
                    {
                        Console.WriteLine("\nWhat would you like to do?");
                        Console.WriteLine("1. Adopt a pet");
                        Console.WriteLine("2. Feed the pets");
                        Console.WriteLine("3. Play with a pet");
                        Console.WriteLine("4. View status of your pets");
                        Console.WriteLine("5. Switch user");
                        Console.WriteLine("6. Switch employee type");
                        Console.WriteLine("7. Quit");
                        Console.WriteLine();

                        Console.Write("> ");
                        string mgrResp = Console.ReadLine();

                        switch (mgrResp)
                        {
                        case "1":
                            Console.Clear();
                            Console.WriteLine("Ok, you'd like to adopt a pet. Please choose one:\n");

                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("For [" + vpshelter.Pets[i].Name + "] type " + i);
                            }
                            Console.WriteLine("\nWhich pet would you like to adopt?\n");

                            Console.Write("> ");
                            string adoptResp = Console.ReadLine().ToLower();

                            switch (adoptResp)
                            {
                            case "0":
                                Console.Clear();
                                Console.WriteLine(manager.Adopt(vpshelter.Pets, vpshelter.Pets[0]) + "\n");
                                break;

                            case "1":
                                Console.Clear();
                                Console.WriteLine(manager.Adopt(vpshelter.Pets, vpshelter.Pets[1]) + "\n");
                                break;

                            case "2":
                                Console.Clear();
                                Console.WriteLine(manager.Adopt(vpshelter.Pets, vpshelter.Pets[2]) + "\n");
                                break;

                            case "3":
                                Console.Clear();
                                Console.WriteLine(manager.Adopt(vpshelter.Pets, vpshelter.Pets[3]) + "\n");
                                break;

                            default:
                                break;
                            }
                            break;

                        case "2":
                            Console.Clear();
                            Console.WriteLine("Ok, you'd like to feed a pet. Please choose one:\n");
                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("For [" + vpshelter.Pets[i].Name + "] type " + i);
                            }
                            Console.WriteLine("For [All Pets] type all\n");
                            Console.WriteLine("Which pet would you like to feed?\n");

                            Console.Write("> ");
                            string feedResp = Console.ReadLine().ToLower();
                            Console.Clear();

                            switch (feedResp)
                            {
                            case "0":
                                Console.WriteLine(manager.Feed(vpshelter.Pets[0]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[0].Hunger + "\n");
                                break;

                            case "1":
                                Console.WriteLine(manager.Feed(vpshelter.Pets[1]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[1].Hunger + "\n");
                                break;

                            case "2":
                                Console.WriteLine(manager.Feed(vpshelter.Pets[2]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[2].Hunger + "\n");
                                break;

                            case "3":
                                Console.WriteLine(manager.Feed(vpshelter.Pets[3]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[3].Hunger + "\n");
                                break;

                            case "all":
                                for (int i = 0; i < vpshelter.Pets.Count; i++)
                                {
                                    Console.WriteLine(manager.Feed(vpshelter.Pets[i]));
                                    Console.WriteLine("Hunger: " + vpshelter.Pets[i].Hunger + "\n");
                                }
                                break;

                            default:
                                break;
                            }
                            break;

                        case "3":
                            Console.Clear();
                            Console.WriteLine("Ok, you'd like to play with a pet. Please choose one:\n");
                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("For [" + vpshelter.Pets[i].Name + "] type " + i);
                            }
                            Console.WriteLine("For [All Pets] type all\n");
                            Console.WriteLine("Which pet would you like to play with?\n");

                            Console.Write("> ");
                            string playResp = Console.ReadLine().ToLower();
                            Console.Clear();

                            switch (playResp)
                            {
                            case "0":
                                Console.WriteLine(manager.Play(vpshelter.Pets[0]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[0].Boredom + "\n");
                                break;

                            case "1":
                                Console.WriteLine(manager.Play(vpshelter.Pets[1]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[1].Boredom + "\n");
                                break;

                            case "2":
                                Console.WriteLine(manager.Play(vpshelter.Pets[2]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[2].Boredom + "\n");
                                break;

                            case "3":
                                Console.WriteLine(manager.Play(vpshelter.Pets[3]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[3].Boredom + "\n");
                                break;

                            case "all":
                                for (int i = 0; i < vpshelter.Pets.Count; i++)
                                {
                                    Console.WriteLine(manager.Play(vpshelter.Pets[i]));
                                    Console.WriteLine("Boredom: " + vpshelter.Pets[i].Boredom + "\n");
                                }
                                break;

                            default:
                                break;
                            }
                            break;

                        case "4":
                            Console.Clear();
                            Console.WriteLine("This is the status of your pets:\n");
                            Console.WriteLine("Name    Desc.   Hunger  Thirst  Boredom");
                            Console.WriteLine("------- ------- ------- ------- -------");

                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("{0}     {1}    {2}      {3}      {4}", vpshelter.Pets[i].Name, vpshelter.Pets[i].Description, vpshelter.Pets[i].Hunger, vpshelter.Pets[i].Thirst, vpshelter.Pets[i].Boredom);
                            }
                            Console.WriteLine();
                            break;

                        case "5":
                            Console.Clear();
                            userMgr = "0";
                            break;

                        case "6":
                            Console.Clear();
                            userMgr      = "0";
                            employeeResp = "0";
                            break;

                        case "7":
                            Console.Clear();
                            userMgr      = "0";
                            employeeResp = "0";
                            userResp     = "2";
                            break;

                        default:
                            break;
                        }
                    }
                }

                while (employeeResp == "2") // Volunteer Menu
                {
                    Console.WriteLine("Which volunteer are you?");
                    Console.WriteLine("1. Heidi");
                    Console.WriteLine("2. Mark");
                    Console.WriteLine("3. Switch employee type");
                    Console.WriteLine("4. Quit");
                    Console.WriteLine();

                    Console.Write("> ");
                    string userVol = Console.ReadLine();

                    if (userVol == "3")
                    {
                        Console.Clear();
                        employeeResp = "0";
                    }
                    if (userVol == "4")
                    {
                        Console.Clear();
                        employeeResp = "0";
                        userResp     = "2";
                    }

                    while (userVol == "1" || userVol == "2")
                    {
                        Console.WriteLine("\nWhat would you like to do?");
                        Console.WriteLine("1. Feed the pets");
                        Console.WriteLine("2. Give water to the pets");
                        Console.WriteLine("3. Play with a pet");
                        Console.WriteLine("4. View status of your pets");
                        Console.WriteLine("5. Switch user");
                        Console.WriteLine("6. Switch employee type");
                        Console.WriteLine("7. Quit");
                        Console.WriteLine();

                        Console.Write("> ");
                        string volResp = Console.ReadLine();

                        switch (volResp)
                        {
                        case "1":     // Feed the pets
                            Console.Clear();
                            Console.WriteLine("Ok, you'd like to feed a pet. Please choose one:\n");
                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("For [" + vpshelter.Pets[i].Name + "] type " + i);
                            }
                            Console.WriteLine("For [All Pets] type all\n");
                            Console.WriteLine("Which pet would you like to feed?\n");

                            Console.Write("> ");
                            string feedResp = Console.ReadLine().ToLower();
                            Console.Clear();

                            switch (feedResp)
                            {
                            case "0":
                                Console.WriteLine(volunteer.Feed(vpshelter.Pets[0]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[0].Hunger + "\n");
                                break;

                            case "1":
                                Console.WriteLine(volunteer.Feed(vpshelter.Pets[1]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[1].Hunger + "\n");
                                break;

                            case "2":
                                Console.WriteLine(volunteer.Feed(vpshelter.Pets[2]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[2].Hunger + "\n");
                                break;

                            case "3":
                                Console.WriteLine(volunteer.Feed(vpshelter.Pets[3]));
                                Console.WriteLine("Hunger: " + vpshelter.Pets[3].Hunger + "\n");
                                break;

                            case "all":
                                for (int i = 0; i < vpshelter.Pets.Count; i++)
                                {
                                    Console.WriteLine(volunteer.Feed(vpshelter.Pets[i]));
                                    Console.WriteLine("Hunger: " + vpshelter.Pets[i].Hunger + "\n");
                                }
                                break;

                            default:
                                break;
                            }
                            break;

                        case "2":     // Give water to the pets
                            Console.Clear();
                            Console.WriteLine("Ok, you'd like to give water to a pet. Please choose one:\n");
                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("For [" + vpshelter.Pets[i].Name + "] type " + i);
                            }
                            Console.WriteLine("For [All Pets] type all\n");
                            Console.WriteLine("Which pet would you like to give water?\n");

                            Console.Write("> ");
                            string waterResp = Console.ReadLine().ToLower();
                            Console.Clear();

                            switch (waterResp)
                            {
                            case "0":
                                Console.WriteLine(volunteer.GiveWater(vpshelter.Pets[0]));
                                Console.WriteLine("Thirst: " + vpshelter.Pets[0].Thirst + "\n");
                                break;

                            case "1":
                                Console.WriteLine(volunteer.GiveWater(vpshelter.Pets[1]));
                                Console.WriteLine("Thirst: " + vpshelter.Pets[1].Thirst + "\n");
                                break;

                            case "2":
                                Console.WriteLine(volunteer.GiveWater(vpshelter.Pets[2]));
                                Console.WriteLine("Thirst: " + vpshelter.Pets[2].Thirst + "\n");
                                break;

                            case "3":
                                Console.WriteLine(volunteer.GiveWater(vpshelter.Pets[3]));
                                Console.WriteLine("Thirst: " + vpshelter.Pets[3].Thirst + "\n");
                                break;

                            case "all":
                                for (int i = 0; i < vpshelter.Pets.Count; i++)
                                {
                                    Console.WriteLine(volunteer.GiveWater(vpshelter.Pets[i]));
                                    Console.WriteLine("Thirst: " + vpshelter.Pets[i].Thirst + "\n");
                                }
                                break;

                            default:
                                break;
                            }
                            break;

                        case "3":     // Play with a pet
                            Console.Clear();
                            Console.WriteLine("Ok, you'd like to play with a pet. Please choose one:\n");
                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("For [" + vpshelter.Pets[i].Name + "] type " + i);
                            }
                            Console.WriteLine("For [All Pets] type all\n");
                            Console.WriteLine("Which pet would you like to play with?\n");

                            Console.Write("> ");
                            string playResp = Console.ReadLine().ToLower();
                            Console.Clear();

                            switch (playResp)
                            {
                            case "0":
                                Console.WriteLine(volunteer.Play(vpshelter.Pets[0]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[0].Boredom + "\n");
                                break;

                            case "1":
                                Console.WriteLine(volunteer.Play(vpshelter.Pets[1]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[1].Boredom + "\n");
                                break;

                            case "2":
                                Console.WriteLine(volunteer.Play(vpshelter.Pets[2]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[2].Boredom + "\n");
                                break;

                            case "3":
                                Console.WriteLine(volunteer.Play(vpshelter.Pets[3]));
                                Console.WriteLine("Boredom: " + vpshelter.Pets[3].Boredom + "\n");
                                break;

                            case "all":
                                for (int i = 0; i < vpshelter.Pets.Count; i++)
                                {
                                    Console.WriteLine(volunteer.Play(vpshelter.Pets[i]));
                                    Console.WriteLine("Boredom: " + vpshelter.Pets[i].Boredom + "\n");
                                }
                                break;

                            default:
                                break;
                            }
                            break;

                        case "4":     // View the status of your pets
                            Console.Clear();
                            Console.WriteLine("This is the status of your pets:\n");
                            Console.WriteLine("Name    Desc.   Hunger  Thirst  Boredom");
                            Console.WriteLine("------- ------- ------- ------- -------");

                            for (int i = 0; i < vpshelter.Pets.Count; i++)
                            {
                                Console.WriteLine("{0}     {1}    {2}      {3}      {4}", vpshelter.Pets[i].Name, vpshelter.Pets[i].Description, vpshelter.Pets[i].Hunger, vpshelter.Pets[i].Thirst, vpshelter.Pets[i].Boredom);
                            }
                            Console.WriteLine();
                            break;

                        case "5":
                            Console.Clear();
                            userVol = "0";
                            break;

                        case "6":
                            Console.Clear();
                            userVol      = "0";
                            employeeResp = "0";
                            break;

                        case "7":     // Quit
                            Console.Clear();
                            userVol      = "0";
                            employeeResp = "0";
                            userResp     = "2";
                            break;

                        default:
                            break;
                        }
                    }
                }
            }

            Console.WriteLine("Thanks for playing!");
        }