static void Main() { Console.WriteLine("---------------------------------------------------------"); Console.WriteLine("Welcome to Pierre's Bakery! Our loaves of bread are $5 and our pastries are only $2!"); Console.WriteLine("We have a couple specials going on at the moment:"); Console.WriteLine("Buy 2 any loaves of bread, get 1 free!"); Console.WriteLine("Buy any pastry for $2 or 3 for $5!"); Console.WriteLine("---------------------------------------------------------"); Console.WriteLine("Please enter the number of loaves of bread you'd like to order today:"); Console.WriteLine("---------------------------------------------------------"); int UserBreadInput = int.Parse(Console.ReadLine()); Bread userBread = new Bread(UserBreadInput, 0); Console.WriteLine("Please enter the number of patries you'd like to order today:"); Console.WriteLine("---------------------------------------------------------"); int UserPastryInput = int.Parse(Console.ReadLine()); Pastry userPastry = new Pastry(UserPastryInput, 0); userBread.BreadDeal(UserBreadInput); userPastry.PastryDeal(UserPastryInput); int Total = userPastry.PastryCost + userBread.BreadCost; Console.WriteLine("Your total today will be $" + Total + "! Thank you for your order of " + userBread.BreadLoaves + " loaves of bread and " + userPastry.PastryNumber + " pastries today, we hope to see you again soon!"); Console.WriteLine("---------------------------------------------------------"); }
public static void Main() { Console.WriteLine("-----------------------------------"); Console.WriteLine("Welcome to Pierre's Bakery! We have loaves of bread for 5 dollars and pastries for 2 dollars."); Console.WriteLine("Our deals today are buy two loaves get one free, and 5 dollars for 3 pastries."); Console.WriteLine("------------------------------------"); Console.WriteLine("How many loaves of bread would you like to order?"); int BreadInput = int.Parse(Console.ReadLine()); Console.WriteLine("------------------------------------"); Console.WriteLine("How many pastries would you like to order?"); int PastryInput = int.Parse(Console.ReadLine()); Console.WriteLine("------------------------------------"); Bread newBread = new Bread(BreadInput, 0); Pastry newPastry = new Pastry(PastryInput, 0); newBread.BreadDeal(BreadInput); newPastry.PastryDeal(PastryInput); int Checkout = newPastry.PastryTotal + newBread.BreadTotal; Console.WriteLine("Your total is: $" + Checkout); Console.WriteLine("------------------------------------"); }