Beispiel #1
0
        static void Main(string[] args)
        {
            string bchoice;

            Console.WriteLine("##### Bill's Burgers ######");
            Console.WriteLine("##### MENU ######");
            Console.WriteLine("Select Option:\n\n1.Regular Burger\n\n2.Healthy Burger\n\n3.Deluxe Burger");
            bchoice = Console.ReadLine()[0].ToString();
            if (bchoice == "1")
            {
                Burger B = new Burger("Chicken", "Plain");
                B.BuildBurger();
            }
            else if (bchoice == "2")
            {
                HealthyBurger HB = new HealthyBurger("Healthy", "Brown Rye Bread");
                HB.BuildBurger();
            }
            else if (bchoice == "3")
            {
                DeluxeBurger DB = new DeluxeBurger("Deluxe", "Special Bread");
                DB.BuildBurger();
            }
            else
            {
                Console.WriteLine("Wrong input");
            }
        }
Beispiel #2
0
        public float BuildBurger()
        {
            Console.WriteLine("Do you want to add..(y/n)");
            Console.WriteLine("lettuce:");
            char l = Console.ReadLine()[0];

            Console.WriteLine("Tomatto:");
            char t = Console.ReadLine()[0];

            Console.WriteLine("Carrot:");
            char c = Console.ReadLine()[0];

            Console.WriteLine("Onion:");
            char o = Console.ReadLine()[0];

            Console.WriteLine("Spinach:");
            char spin = Console.ReadLine()[0];

            Console.WriteLine("Olive:");
            char oliv = Console.ReadLine()[0];
            bool let, car, on, tom, spina, olive;

            if (l == 'y')
            {
                let = true;
            }
            else
            {
                let = false;
            }

            if (t == 'y')
            {
                tom = true;
            }
            else
            {
                tom = false;
            }

            if (o == 'y')
            {
                on = true;
            }
            else
            {
                on = false;
            }

            if (c == 'y')
            {
                car = true;
            }
            else
            {
                car = false;
            }



            if (spin == 'y')
            {
                spina = true;
            }
            else
            {
                spina = false;
            }

            if (oliv == 'y')
            {
                olive = true;
            }
            else
            {
                olive = false;
            }



            HealthyBurger newburger = new HealthyBurger("Healthy", "Brown Rye Bread Roll");

            newburger.addAdditions(let, tom, car, on, spina, olive);
            return(newburger.Getfinalprice());
        }