示例#1
0
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();

            summerMenu.Name = "Summer Menu";

            summerMenu.AddMenuItem("Salmon", "Fresh salmon", 25.50);
            summerMenu.AddMenuItem("Taco", "Great tacos", 10);
            summerMenu.HospitalDirections = "5th right around the corner";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.Disclaimer = "Do not drink and drive";
            outsideDrinks.AddMenuItem("Virgin Cuba Libre", "A classic drink", 10);
            outsideDrinks.AddMenuItem("Screwdriver", "Great", 15);

            Order hungryGuestOrder = new Order();

            for (int x = 0; x <= summerMenu.items.Count - 1; x++)
            {
                MenuItem currentItem = summerMenu.items[x];
                hungryGuestOrder.items.Add(currentItem);
            }

            foreach (MenuItem currentItem in outsideDrinks.items)
            {
                hungryGuestOrder.items.Add(currentItem);
            }

            Console.WriteLine($"The total is: ${hungryGuestOrder.Total}");
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();

            summerMenu.Name = "Summer menu";
            summerMenu.AddMenuItem("Salmon", "Fresh Lake Superior Salmon with an uncomfortable amount of Mayonnaise", 25.50);
            summerMenu.AddMenuItem("Tacos", "Isnt everyday taco tuesday", 10);
            summerMenu.HospitalDirections = "Right around the corner of 5th street. Ask for Dr. Howser";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.Disclaimer = "Do not drink and code";
            outsideDrinks.AddMenuItem("Whiskey Sour", "The best of all the classics", 10);
            outsideDrinks.AddMenuItem("Vesper Martini", "Shaken, not stirred", 15);


            Order hungryGuestOrder = new Order();

            for (int x = 0; x <= summerMenu.items.Count - 1; x++)
            {
                MenuItem currentItem = summerMenu.items[x];
                hungryGuestOrder.items.Add(currentItem);
            }

            foreach (MenuItem currentItem in outsideDrinks.items)
            {
                hungryGuestOrder.items.Add(currentItem);
            }

            Console.WriteLine("The total is:" + hungryGuestOrder.Total);

            try
            {
                outsideDrinks.AddMenuItem("French 75", "You think you're so fancy ordering this, don't you?", 0);
            }
            catch (Exception thrownException)
            // This will stop our program from erroring out and just show an error message in the console. It continues to run even after we have recieved an exception
            {
                Console.WriteLine(thrownException.Message);
            }


            Console.ReadKey();
        }
示例#3
0
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();

            summerMenu.Name = "Summer menu";
            summerMenu.AddMenuItem("Salmon", "Fresh Norwegian Salmon with Sandefjord butter.", 25.50);
            summerMenu.AddMenuItem("Taco", "All Norwegians eat taco on Fridays.", 10);
            summerMenu.HospitalDirections = "Right around the corner of 5th street. Ask for Dr. Jones.";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.Disclaimer = "Do not drink and code.";
            outsideDrinks.AddMenuItem("Virgin Cuba Libre", "A classic.", 10);
            outsideDrinks.AddMenuItem("Screwdriver", "Makes you hammered.", 15);

            Order hungryGuestOrder = new Order();

            for (int x = 0; x <= summerMenu.items.Count - 1; x++)
            {
                MenuItem currentItem = summerMenu.items[x];
                hungryGuestOrder.items.Add(currentItem);
            }

            foreach (MenuItem currentItem in outsideDrinks.items)
            {
                hungryGuestOrder.items.Add(currentItem);
            }

            Console.WriteLine("The total is:" + hungryGuestOrder.Total);

            try
            {
                outsideDrinks.AddMenuItem("Himkok", "9 of 10 people recommend staying away from this drink", 0);
            }
            catch (Exception thrownException)
            {
                Console.WriteLine(thrownException.Message);
            }


            Console.ReadKey();
        }
示例#4
0
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();

            summerMenu.Name = "Summer Menu";
            summerMenu.AddMenuItem("Salmon", "Norwegian salmon with butter", 25.50);
            summerMenu.AddMenuItem("Robalo", "Colombian robalo with butter", 25.50);
            summerMenu.HospitalDirections = "Alli abajito";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.Disclaimer = "Do not drink and code";
            outsideDrinks.AddMenuItem("Aguila", "Cerveza colombiana", 4);
            outsideDrinks.AddMenuItem("Apostol", "Cerveza colombiana", 4);

            Order hungryGuestOrder = new Order();

            for (int i = 0; i <= summerMenu.Items.Count - 1; i++)
            {
                MenuItem currentItem = summerMenu.Items[i];
                hungryGuestOrder.Item.Add(currentItem);
            }
            foreach (MenuItem currentItem in outsideDrinks.Items)
            {
                hungryGuestOrder.Item.Add(currentItem);
            }

            Console.WriteLine("The total is: " + hungryGuestOrder.Total);

            try
            {
                outsideDrinks.AddMenuItem("Apostol", "Cerveza colombiana", 0);
            }
            catch (Exception thrownException)
            {
                Console.WriteLine(thrownException.Message);
            }

            Console.ReadKey();
        }
示例#5
0
        private static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();
            summerMenu.Name = "Summer menu";
            summerMenu.AddMenuItem("Salmon", "Fresh Norwegian Salmon with Sandefjord butter.", 25.50);
            summerMenu.AddMenuItem("Taco", "All Norwegians eat taco on Fridays.", 10);
            summerMenu.HospitalDirections = "Right around the corner of 5th street, Ask for Dr. Jones.";

            DrinkMenu outsideDrinks = new DrinkMenu();
            outsideDrinks.Disclaimer = "Do not drink and code.";
            outsideDrinks.AddMenuItem("Virgin Cuba Libre", "A classic.", 10);
            outsideDrinks.AddMenuItem("Screwdriver", "Makes you hammered.", 15);

            Order hungryGuestOrder = new Order();

            for (int x = 0; x <= summerMenu.items.Count-1; x++)
            {
                MenuItem currentItem = summerMenu.items[x];
                hungryGuestOrder.items.Add(currentItem);
            }

            foreach (MenuItem currentItem in outsideDrinks.items)
            {
                hungryGuestOrder.items.Add(currentItem);
            }

            Console.WriteLine("The total is:" + hungryGuestOrder.Total);
            Console.ReadKey();

            try
            {

                outsideDrinks.AddMenuItem("Himkok", "9 of 10 people recommend staying away from this d" +
                                                    "rink.", 0);
            }
            catch (Exception thrownException)
            {
                Console.WriteLine(thrownException.Message);
            }
        }
示例#6
0
        static void Main(string[] args)
        {
            FoodMenu SummerMenu = new FoodMenu();
            SummerMenu.Name = "Summer Menu";
            SummerMenu.AddMenuItem("Salmon", "Fresh Norwegian Salmon with Sandfjord Butter.", 25.50);
            SummerMenu.AddMenuItem("Taco", "All Norwegains eat tacos on Friday.", 10);
            SummerMenu.HosptialDirections = "Right around the corner off of 5th street";

            DrinkMenu outsideDrinks = new DrinkMenu();
            outsideDrinks.Disclaimer = "Do not drink and code.";
            outsideDrinks.AddMenuItem("ScrewDriver", "Makes you hammered.", 15);

            Order HungryGuestOrder = new Order();
            for (int x=0;x<=SummerMenu.items.Count-1;x++)
            {
                MenuItem currentitem = SummerMenu.items[x];
                HungryGuestOrder.items.Add(currentitem);
            }

            foreach (MenuItem currentItem in outsideDrinks.items)
            {

                HungryGuestOrder.items.Add(currentItem);
            }

            Console.WriteLine("The total is:" + HungryGuestOrder.Total);

            try
            {
                outsideDrinks.AddMenuItem("Wine", "It tastes good!", 0.00);

            }
            catch (Exception thrownException)
            {
                Console.WriteLine(thrownException.Message);

            }

            Console.ReadKey();
        }
示例#7
0
        static void Main(string[] args)
        {
            FoodMenu summerMenue = new FoodMenu();

            summerMenue.Name = "Summer Menue 2019";
            summerMenue.AddMenuItem("Salmon", "Fresh salmon from Oslo", 25.50);
            summerMenue.AddMenuItem("Taco", "Norge eat taco on Fridays", 10.05);
            summerMenue.HospitalDirections = "Right and left and Hospital is right there !";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.Disclaimer = "Do not drink !";
            outsideDrinks.AddMenuItem("Cuban", "Classic", 10);
            outsideDrinks.AddMenuItem("Screwdriver", "Kit", 15);

            Order orderHungryCustomer = new Order();

            for (int x = 0; x < summerMenue.items.Count; x++)
            {
                MenuItem currentitem = summerMenue.items[x];
                orderHungryCustomer.items.Add(currentitem);
            }

            foreach (MenuItem currentitem in outsideDrinks.items)
            {
                orderHungryCustomer.items.Add(currentitem);
            }

            Console.WriteLine("Total is: " + orderHungryCustomer.Total);

            try
            {
                outsideDrinks.AddMenuItem("Himchok", "Drink all!!", 0);
            }
            catch (Exception thrownException)
            {
                Console.WriteLine(thrownException.Message);
            }
        }
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();

            summerMenu.Name = "Summer Menu";
            summerMenu.AddMenuItem("Salmon", "Fresh Salmon", 25.99);
            summerMenu.AddMenuItem("Chips", "Homemade Chips", 4.99);
            summerMenu.AddMenuItem("Pizza", "Pizza of your choice!", 14.99);
            summerMenu.HospitalDirections = "Down the street";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.Disclaimer = "Alcoholic drinks are 18+";
            outsideDrinks.AddMenuItem("Lemonade", "Sweet Bubbly drink", 4.00);

            Order HungryGuest = new Order();

            for (int x = 0; x <= summerMenu.items.Count - 1; x++)
            {
                MenuItem currentItem = summerMenu.items[x];
                HungryGuest.items.Add(currentItem);
            }

            foreach (MenuItem currentItem in outsideDrinks.items)
            {
                HungryGuest.items.Add(currentItem);
            }

            Console.WriteLine("The total price for the order is: " + HungryGuest.Total);

            try
            {
                outsideDrinks.AddMenuItem("Lemonade", "Sweet Bubbly drink", 0);
            }
            catch (Exception thrownException)
            {
                Console.WriteLine(thrownException.Message);
            }
        }
示例#9
0
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();

            summerMenu.Name = "Summer Menu";
            summerMenu.addMenuItem("Salmon", "Fresh Norwegian Salmon with butter", 25.50);
            summerMenu.addMenuItem("Taco", "norwegian tacos number one", 150.50);
            summerMenu.hospitalDirection = "Right around the corner on 5th St ask for Dr. Jones";

            DrinkMenu outsideDrinks = new DrinkMenu();

            outsideDrinks.disclaimer = "Do not drink and code.";
            outsideDrinks.addMenuItem("Jack Daniels", "a type of rum", 300.50);

            Order hungryGuestOrder = new Order();

            for (int x = 0; x <= summerMenu.items.Count - 1; x++)
            {
                MenuItem currentItem = summerMenu.items[x];
                hungryGuestOrder.items.Add(currentItem);
            }
//random comments again
            foreach (MenuItem currentItem in outsideDrinks.items)
            {
                hungryGuestOrder.items.Add(currentItem);
            }

            Console.WriteLine("The total is: " + hungryGuestOrder.total);

            try {
                outsideDrinks.addMenuItem("Jin", "a type of tequila", 0);
            }
            catch (Exception thrownException) {
                Console.WriteLine(thrownException.Message);
            }
            Console.ReadKey();
        }
示例#10
0
        static void Main(string[] args)
        {
            FoodMenu summerMenu = new FoodMenu();
            summerMenu.Name = "Summer menu";
            summerMenu.AddMenuItem("Salmon", "Fresh Norwegian fish", 25.50);
            summerMenu.AddMenuItem("Taco", "Mexican taco", 12.50);
            summerMenu.HospitalDirections = "Right around the corner";

            DrinkMenu outsideDrinks = new DrinkMenu();
            outsideDrinks.Disclaimer = "Do not drink and drive!";
            outsideDrinks.AddMenuItem("Pan galactic gargle blaster", "Will knock your socks off!", 20.00);
            outsideDrinks.AddMenuItem("Mohito", "A classic", 13.00);

            Order hungryGuestOrder = new Order();
            for (int i = 0; i < summerMenu.items.Count; i++)
            {
                hungryGuestOrder.items.Add(summerMenu.items[i]);
            }

            foreach (MenuItem item in outsideDrinks.items)
            {
                hungryGuestOrder.items.Add(item);
            }
        }