Пример #1
0
        public static void Main()
        {
            Console.WriteLine(@" ______  __   ______   ______   ______   ______   ______       ______   ______   __  __   ______   ______   __  __    ");
            Console.WriteLine(@"/\  == \/\ \ /\  ___\ /\  == \ /\  == \ /\  ___\ /\  ___\     /\  == \ /\  __ \ /\ \/ /  /\  ___\ /\  == \ /\ \_\ \   ");
            Console.WriteLine(@"\ \  _-/\ \ \\ \  __\ \ \  __< \ \  __< \ \  __\ \ \___  \    \ \  __< \ \  __ \\ \  _'-.\ \  __\ \ \  __< \ \____ \  ");
            Console.WriteLine(@" \ \_\   \ \_\\ \_____\\ \_\ \_\\ \_\ \_\\ \_____\\/\_____\    \ \_____\\ \_\ \_\\ \_\ \_\\ \_____\\ \_\ \_\\/\_____\ ");
            Console.WriteLine(@"  \/_/    \/_/ \/_____/ \/_/ /_/ \/_/ /_/ \/_____/ \/_____/     \/_____/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/ \/_____/ ");
            Console.WriteLine(@"                                                                                                                      ");
            Console.WriteLine("Hello User; Welcome to the future of bread ordering!");
            Console.WriteLine("We have two items for sale. Bread and Pastry.");
            Console.WriteLine("Bread is $5 and is on a Buy 2 Get 1 FREE special!");
            Console.WriteLine("How many bread do you want?");
            string stringBreadLoafs = Console.ReadLine();

            Console.WriteLine("Pastries are Buy 1 for $2 or 3 for $5");
            Console.WriteLine("How many Pastry do you want?");
            string stringPastryItem = Console.ReadLine();

            int userBreadLoafs = int.Parse(stringBreadLoafs);
            int pastryItem     = int.Parse(stringPastryItem);

            Bread  userBread   = new Bread(userBreadLoafs);
            int    breadTotal  = Bread.BreadTotal(userBreadLoafs);
            Pastry userPastry  = new Pastry(pastryItem);
            int    pastryTotal = Pastry.PastryTotal(pastryItem);

            Console.WriteLine($"Your order bread total {breadTotal} and your pastry total is {pastryTotal}");
        }
Пример #2
0
        static void Main()
        {
            Console.WriteLine("Ciao!");
            Console.WriteLine("We have some specials today so let me fill you in");
            Console.WriteLine("Today our bread which is $5 a loaf is buy 2 get one free and");
            Console.WriteLine("our Pastry which is $2 a piece is $5 for 3 of them.");
            Console.WriteLine("Would you like to make an order? 'Y' for yes, 'Enter' for no");
            string answer = Console.ReadLine();

            if (answer == "Y" || answer == "y")
            {
                Console.WriteLine("Terrific! how many loafs of Bread can i get for you?");
                int   breadQuantity = int.Parse(Console.ReadLine());
                Bread newBread      = new Bread(breadQuantity);
                if (breadQuantity >= 0)
                {
                    Console.WriteLine("Terrific! how many pastry ya want?");
                }
                int    pastryQuantity = int.Parse(Console.ReadLine());
                Pastry newPastry      = new Pastry(pastryQuantity);
                if (pastryQuantity >= 0)
                {
                    newBread.BreadTotal(breadQuantity);
                    newPastry.PastryTotal(pastryQuantity);
                    Console.WriteLine(" The cost of your the bread is $" + newBread.Total + " and your Pastries come to a total of $" + newPastry.Total);
                    Console.WriteLine("Grazie Mille Tutti!  Ciao!");
                    Console.WriteLine("type 'dotnet run' to make another order");
                }
            }
        }
Пример #3
0
        public static void Start()
        {
            Console.WriteLine("How many loaves of bread would you like?");
            string breadInput = Console.ReadLine();

            if (numberChecker(breadInput) == false)
            {
                Console.WriteLine("Please enter a number with no spaces or extra characters");
                Start();
            }

            Console.WriteLine("How many pastries would you like?");
            string pastryInput = Console.ReadLine();

            if (numberChecker(pastryInput) == false)
            {
                Console.WriteLine("Please enter a number with no spaces or extra characters");
                Start();
            }
            int    parsedPastry = int.Parse(pastryInput);
            int    parsedBread  = int.Parse(breadInput);
            Bread  bread1       = new Bread(parsedBread);
            Pastry pastry1      = new Pastry(parsedPastry);
            Order  order1       = new Order(bread1.BreadTotal(), pastry1.PastryTotal());

            Console.WriteLine("Thank you. For " + breadInput + " loaves of bread and " + pastryInput + " pastries, your total is $" + order1.OrderTotal());
        }
Пример #4
0
        public static void Main()
        {
            Console.Clear();
            Bread  bread  = new Bread();
            Pastry pastry = new Pastry();

            Console.ForegroundColor = ConsoleColor.Red;
            TypeLine("Please Enter Your Name to Start Your Order");
            string userName = Console.ReadLine().ToUpper();

            TypeLine("Hello " + userName + "," + " welcome to 'La Boulangerie' bakery!");
            TypeLine("----------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            TypeLine("Please select from our Menu: ");
            TypeLine("Bread: $5each or Buy 2 and get 1 FREE");
            TypeLine("Pastry: $2each or Buy 3 for $5");
            TypeLine("----------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            TypeLine("Would you like to order Bread or Pastry?");
            string userOrder = Console.ReadLine().ToLower();

            if (userOrder == "bread")
            {
                TypeLine("How many loafs of bread would you like?");
                string loafQuont = Console.ReadLine();
                int    loafNum   = int.Parse(loafQuont);
                bread.BreadPrice(loafNum);
                TypeLine($"Bread order summary: Total number of bread(s): {loafNum} Price: $ {bread.LoafPrice}");
            }
            else if (userOrder == "pastry")
            {
                TypeLine("How many of the pasties would you like?");
                string pastryQuont = Console.ReadLine();
                int    pastryNum   = int.Parse(pastryQuont);
                pastry.PastryTotal(pastryNum);
                TypeLine($"Pastry order summary: Total number of pastr(y/ies): {pastryNum} Price: $ {pastry.PastryPrice}");
            }
            else
            {
                TypeLine("Please select an item that is on the menu!");
            }
            System.Threading.Thread.Sleep(3000);
            Main();
        }
Пример #5
0
        public static void Main()
        {
            Console.WriteLine("---------------------");
            Console.WriteLine("Welcome to Pierre's Bakery!");
            Console.WriteLine("---------------------");
            Console.WriteLine("Today we have fresh loaves of bread and pastries!");
            Console.WriteLine("Current Prices & Sales:");
            Console.WriteLine("Bread Single: $5.00");
            Console.WriteLine("~Bread Sale~");
            Console.WriteLine("Buy two loaves of bread get one free.");
            Console.WriteLine("---------------------");
            Console.WriteLine("Pastry Single: $2.00");
            Console.WriteLine("~Pastry Sale~");
            Console.WriteLine("Get three pastries for $5.00");
            Console.WriteLine("---------------------");
            Console.WriteLine("WOULD YOU LIKE TO CREATE A NEW ORDER? (Yes/No):");

            string response1 = Console.ReadLine().ToUpper();

            if (response1 == "YES")
            {
                Console.WriteLine("---------------------");
                Console.WriteLine("How many loaves of bread would you like?");
                Console.WriteLine("Please enter a quantity:");
                int   breadQuantity = int.Parse(Console.ReadLine());
                Bread newBread      = new Bread(breadQuantity);
                if (breadQuantity >= 0)
                {
                    newBread.BreadTotal(breadQuantity);
                }
                else
                {
                    Console.WriteLine("-----------------------------");
                    Console.WriteLine("There was a problem...Please check your response and try again...");
                    Console.WriteLine("Would you like to try again? (Yes/No):");
                    string restart = Console.ReadLine().ToUpper();
                    if (restart == "YES")
                    {
                        Program.Main();
                    }
                    else
                    {
                        Console.WriteLine("Thank you!");
                    }
                }
                Console.WriteLine("---------------------");
                Console.WriteLine("How many pastries would you like?");
                Console.WriteLine("Please enter a quantity:");
                int    pastryQuantity = int.Parse(Console.ReadLine());
                Pastry newPastry      = new Pastry(pastryQuantity);
                if (pastryQuantity >= 0)
                {
                    newPastry.PastryTotal(pastryQuantity);
                }
                else
                {
                    Console.WriteLine("-----------------------------");
                    Console.WriteLine("There was a problem...Please check your response and try again...");
                    Console.WriteLine("Would you like to try again? (Yes/No):");
                    string restart = Console.ReadLine().ToUpper();
                    if (restart == "YES")
                    {
                        Program.Main();
                    }
                    else
                    {
                        Console.WriteLine("Thank you!");
                    }
                }
                newBread.BreadTotal(breadQuantity);
                newPastry.PastryTotal(pastryQuantity);
                Console.WriteLine("---------------------");
                Console.WriteLine("The total price for " + newBread.Quantity + " loaf/loaves is $" + newBread.Total + ".00");
                Console.WriteLine("The total price for " + newPastry.Quantity + " pastry/pastries is $" + newPastry.Total + ".00");
                Console.WriteLine("---------------------");
                Console.WriteLine("Is this correct? (Yes/No)");
                string response2 = Console.ReadLine().ToUpper();
                if (response2 == "YES")
                {
                    Order newOrder = new Order(newBread.Total, newPastry.Total);
                    Console.WriteLine("Your total price for this order is: (Bread) $" + newBread.Total + ".00 + " + "(Pastry) $" + newPastry.Total + ".00 = " + "Total: $" + newOrder.Total(newOrder.BreadTotal, newOrder.PastryTotal));
                    Console.WriteLine("Thank you for Ordering with Pierre's Bakery!");
                }
                else if (response2 == "NO")
                {
                    Console.WriteLine("Would you like to try again? (Yes/No):");
                    string restart = Console.ReadLine().ToUpper();
                    if (restart == "YES")
                    {
                        Program.Main();
                    }
                    else
                    {
                        Console.WriteLine("Thank you!");
                    }
                }
                else
                {
                    Console.WriteLine("-----------------------------");
                    Console.WriteLine("There was a problem...Please check your response and try again...");
                    Console.WriteLine("Would you like to try again? (Yes/No):");
                    string restart = Console.ReadLine().ToUpper();
                    if (restart == "YES")
                    {
                        Program.Main();
                    }
                    else
                    {
                        Console.WriteLine("Thank you!");
                    }
                }
            }
            else if (response1 == "NO")
            {
                Console.WriteLine("---------------------");
                Console.WriteLine("Thank you!");
            }
            else
            {
                Console.WriteLine("-----------------------------");
                Console.WriteLine("There was a problem...Please check your response and try again...");
                Console.WriteLine("Would you like to try again? (Yes/No):");
                string restart = Console.ReadLine().ToUpper();
                if (restart == "YES")
                {
                    Program.Main();
                }
                else
                {
                    Console.WriteLine("Thank you!");
                }
            }
        }