Okay so I'm finishing up a project and just realized that I needed to loop the questions so that it'll ask how many chicken panini's the customer wants, store that value and do the same for the roast beef sandwich. I also need help in getting the number (amount the customer wants) to be printed at the bottom to the "receipt" portion of the code.
The questions I need help being looped are lines 28-52 and the receipt portion or at least the start of it is at the bottom. What I need is someone to
explain to me how to loop the questions (not really do it). I also need to know how to get the loop to stop after the customer chooses to finalize the order. That's the bold code.
CODE
using System;
public class OrdersTest
{
public static void Main()
{
//the following are order objects
Orders order1 = new Orders( 0.00M );
Orders order2 = new Orders( 0.00M );
Orders order3 = new Orders( 0.00M );
Orders order4 = new Orders( 0.00M );
Console.WriteLine("Bleecker Street Menu");
//the menu
string prompt = "Jack Chicken Hot Panini - $5.99\nTarragon Roast Beef Sandwich - $4.99\nMandarin Cranberry Crunch Salad - $4.59\nSoup of the Day - $2.99";
decimal orderAmount1; //the number the customer inputs for chicken
decimal orderAmount2; //input for roast beef
decimal orderAmount3; //input for salad
decimal orderAmount4; //input for soup
//display menu and ask question.
//Chicken order
Console.WriteLine(prompt);
Console.WriteLine("\n{0}",
"Enter how many Jack Chicken Hot Panini's you want.");
orderAmount1 = Convert.ToDecimal(Console.ReadLine());//where the customer input's their order
order1.First(orderAmount1);
Console.WriteLine("your total for the Jack Chicken Hot Panini is: {0:C}", order1.Balance);
//Roat Beef Order
Console.WriteLine("{0}",
"Enter how many Terragon Roast Beef Sandwich's you want.");
orderAmount2 = Convert.ToDecimal(Console.ReadLine());//where the customer input's their order
order2.Second(orderAmount2);
Console.WriteLine("your total for the Terragon Roast Beef Sandwich is: {0:C}", order2.Balance);
//Mandarin Salad Order
Console.WriteLine("{0}",
"Enter how many Mandarin Cranberry Crunch Salad's you want.");
orderAmount3 = Convert.ToDecimal(Console.ReadLine());//where the customer input's their order
order3.Third(orderAmount3);
Console.WriteLine("your total for the Mandarin Cranberry Crunch Salad is: {0:C}", order3.Balance);
//Salad Order
Console.WriteLine("{0}",
"Enter how many Salad of the Day's you want.");
orderAmount4 = Convert.ToDecimal(Console.ReadLine());//where the customer input's their order
order4.Fourth(orderAmount4);
Console.WriteLine("your total for the Salad of the Day is: {0:C}", order4.Balance);
This post has been edited by Taccora: 8 Oct, 2008 - 01:05 PM