Example #1
0
        static void Main(string[] args)
        {
            Menu menu = new Menu();

            menu.AddMenuItem(new MenuItem("Roast Pork Loin", 19.95, "Slow roasted pork loin finished with a portabella demi-glace.", "main course"));
            menu.AddMenuItem(new MenuItem("Spinach Salad", 7.95, "Fresh spinach, mushrooms, and hard-boiled egg served with warm bacon vinaigrette.", "appetizer", false));
            menu.AddMenuItem(new MenuItem("Profiterole", 7.99, "Salted Caramel Ice Cream, Chocolate Sauce, Caramelized Pecan", "dessert"));
            menu.AddMenuItem(new MenuItem("Profiterole", 17.99, "Salted Caramel Ice Cream, Chocolate Sauce, Caramelized Pecan", "dessert"));
            Console.WriteLine(menu);

            Console.WriteLine(menu.MenuItems[2].Equals(menu.MenuItems[3]).ToString());
            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            var myPlace = new Restaurant("My Place");

            myPlace.Address     = "42 wallaby way Sydney";
            myPlace.Description = "The best place to eat. Period.";
            myPlace.History     = "We've been around, for some time.";

            var myMenu = new Menu();

            for (int i = 0; i < 20; i++)
            {
                var menuItem = Generator.GenerateMenuItem();
                myMenu.AddMenuItem(menuItem);
            }

            myPlace.AddMenu("Lunch", myMenu);


            Console.WriteLine(myPlace);
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("done... press 'enter' to exit");
            var showMore = Console.ReadLine();

            if (!string.IsNullOrWhiteSpace(showMore))
            {
                Console.WriteLine(myPlace.ShowIdentities());
                Console.Read();

                Console.WriteLine("done... press 'enter' to exit");
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Max's tasty menu!");
            var menu = new Menu();

            menu.AddMenuItem(new MenuItem("Hamburger", .99, "Mystery meat in link form.", "Main Course", false));
            menu.AddMenuItem(new MenuItem("Mac n Cheese", 1.99, "Macoroni and cheese powder.", "Side", false));
            menu.AddMenuItem(new MenuItem("Humus and Pita", 3, "Freshly made humus with pita.", "Appetizer", true));

            foreach (var menuItem in menu.MenuItems)
            {
                Console.WriteLine(menuItem);
            }

            Console.ReadKey();
        }
Example #4
0
        static void Main(string[] args)
        {
            MenuItem MozarellaPizza    = new MenuItem("Mozarella Pizza", "A classic pizza", "Pizza", 8.00);
            MenuItem Spaghetti         = new MenuItem("Spaghetti", "A delicious pasta", "Pasta", 5.50, false);
            Menu     ItalianRestaurant = new Menu("Italian Restaurant");

            Console.WriteLine(ItalianRestaurant.GetLastUpdate());

            Console.WriteLine(Spaghetti.IsNewItem());
            Console.WriteLine(MozarellaPizza.Equals(Spaghetti));
            Console.WriteLine(MozarellaPizza);

            ItalianRestaurant.AddMenuItem(MozarellaPizza);
            ItalianRestaurant.AddMenuItem(Spaghetti);
            Console.WriteLine(ItalianRestaurant);
            ItalianRestaurant.RemoveMenuItem(Spaghetti);
            Console.WriteLine(ItalianRestaurant);
            Console.WriteLine(ItalianRestaurant.GetLastUpdate());
        }
Example #5
0
        static void Main(string[] args)
        {
            MenuItem pancakes = new MenuItem("Pancakes", 8, "Whole wheat baked", true, Category.Dessert);
            MenuItem soup     = new MenuItem("Soup", 6, "Winter vegetable soup", false, Category.Main_Course);

            Menu day1 = new Menu("Monday", DateTime.Today);

            day1.AddMenuItem(pancakes);
            day1.AddMenuItem(soup);

            Console.WriteLine(day1);


            //Console.WriteLine(pancakes);
            //Console.WriteLine();
            //Console.WriteLine(soup);
            //Console.WriteLine();

            Console.ReadLine();
        }
Example #6
0
        static void Main(string[] args)
        {
            //Create a Menu reference object
            Menu breakfastMenu = new Menu("Breakfast Menu", 1);

            //Add waffle breakfast as menu item to breakfast menu
            Dictionary <string, string> waffleBreakfast = new Dictionary <string, string>()
            {
                { "waffles", "blueberry syrup and butter over waffles" }
            };
            int testId = breakfastMenu.AddMenuItem(1000, waffleBreakfast, 5.99, "breakfast", "new");

            //replace breakfast menu items with testId
            breakfastMenu.NumberOfItems = testId;
            Console.WriteLine(breakfastMenu.NumberOfItems);
            Console.ReadLine();
        }
Example #7
0
        static void Main(string[] args)
        {
            // test data

            /*MenuItem lasagna = new MenuItem("Lasagna", "Our secret recipe - delicious", "Main Course");
             * MenuItem filetMignon = new MenuItem("Filet Mignon", "Our aged beef - delicious", "Main Course");
             * MenuItem ceaserSalad = new MenuItem("Ceaser Salad", "Very fresh - delicious", "Appetizer");
             * MenuItem calamari = new MenuItem("Calamari", "Our secret sauce - delicious", "Appetizer");
             * MenuItem cheeseCake = new MenuItem("Cheese Cake", "Straight from NY - delicious", "Dessert");
             * MenuItem pieAlaMode = new MenuItem("Apple Pie a la Mode ", "Nice and hot - delicious", "Dessert"); */

            //create new menu and stroe it in variabvle titled tastys with a name of Tasty's - Friday's Specials
            Menu tastys = new Menu("Tasty's - Friday's Specials");

            //add 3 menu items to teh menu
            tastys.AddMenuItem("Lasagna", "Our secret recipe - delicious", "Main Course");
            tastys.AddMenuItem("Filet Mignon", "Our aged beef - delicious", "Main Course");
            tastys.AddMenuItem("Cheese Cake", "Straight from NY - delicious", "Dessert");

            //show the menu
            tastys.ShowMenu();
            Console.ReadLine();

            //remove a menu item and show the resulting menu
            tastys.RemoveMenuItem("Lasagna", 1);  // note we knbow the id is one - in prodcustion ShowMenuIyem will display the ID for you
            tastys.ShowMenu();
            Console.ReadLine();

            //add another menu item called cheese cake and see if it gets rejected
            //search for menu tem Cheese Cake - it should be there twice
            // and finally search for an item tyhat is not there - returns message saying menu item not found
            tastys.AddMenuItem("Cheese Cake", "Straight from NY - delicious", "Dessert");
            tastys.AddMenuItem("Cheese Cake", "Straight - NY - delicious", "Dessert");
            tastys.AddMenuItem("Cheese Cake", "Straight from NY - delicous", "Dessert");
            tastys.GetMenuItem("Cheese Cake");
            tastys.GetMenuItem("Cheese ake");

            Console.ReadLine();
            MenuItem compare1 = tastys.GetMenuItem("Filet Mignon");
            MenuItem compare2 = tastys.GetMenuItem("Cheese Cake");

            Console.WriteLine("We are here at the  compare section - hit return to execut4e teh compare commands test");
            Console.ReadLine();
            if (compare1.Equals(compare2))
            {
                Console.WriteLine(compare1.Name + " is the same as " + compare2.Name);
            }
            else
            {
                Console.WriteLine(compare1.Name + " is not the same as " + compare2.Name);
            }
            Console.ReadLine();
        }