Exemplo n.º 1
0
        public static void StartBakery()
        {
            Console.WriteLine("Welcome to my Bakery please enter in how many pastries you would like to purchase today?");
            int    aNumber = int.Parse(Console.ReadLine());
            Pastry pastry1 = new Pastry(aNumber);

            pastry1.CalculatePastryPrice();
            Console.WriteLine(pastry1.Price);


            Console.WriteLine("Enter in how many loafs of bread");
            int   anotherNumber = int.Parse(Console.ReadLine());
            Bread bread         = new Bread(anotherNumber);

            bread.CalculateBreadPrice();
            Console.WriteLine(bread.Price);


            Console.WriteLine("Would you like to add to your order?");
            string answer = Console.ReadLine();

            if (answer == "y")
            {
                // recursive function
                StartBakery();
            }
            else
            {
                //     // show total price
                Program.GetList();
                System.Environment.Exit(2);
            }
        }