title: Nested while loop with trailer values
body: <p>The purpose of my program is to be a virtual McDonalds cashier.  The first part of my program lets the cashier take one customers order.  Thanks to the while loop the customer can order as many items as he/she wants. In the end it displays the tax, subtotal, and final bill.  Along with how much the user pays with and their change.  Now I need my program to do all of the first part, but I need the user/cashier to do this for as many customers that are in line.  I tried nest the two while loops together, but I'm doing something wrong and I don't know what.  Can someone help me?  By the way, the first part works 100%.</p>
  
  <h1>first part</h1>
  
  <pre><code>num1 = 4.87
  num2 = 5.03
  num3 = 5.50
  num4 = 9.45
  num5 = 1.29
  num6 = 2.19
  num7 = 2.29
  itemnum = 0
  Subtotal = 0
  tax = 0.0565
  amtgiven = 0
  change = 0
  quantity = 0
  foodprice = 0
  Totalprice1 = 0
  Totalprice2 = 0
  Totalprice3 = 0
  Totalprice4 = 0
  Totalprice5 = 0
  Totalprice6 = 0
  Totalprice7 = 0
  billtax = 0
  finalbill = 0
  change = 0
  
  print "Welcome to Virtual McDonald's!"   "Would you like to order a food item"
  print "Item:                     Meal/tem:                          Price:"
  print "1                          Big Mac Meal                        4.87"
  print "2                          Quarter Pounder Meal                5.03"
  print "3                          Chicken Nuggets Meal (5 piece)      5.50"
  print "4                          ChickenNuggets Meal (10 piece)      9.45"
  print "5                          Apple Pie                           1.29"
  print "6                          Large Drink                         2.19"
  print "7                          Large Fries                         2.29"
  
  itemnum = input("Enter the item you would like to purchase! ")
  quantity = input("How many of this item do you want?")
  while itemnum != -1:
  
      if itemnum == 1:
          foodprice = quantity * num1
          Totalprice1 = foodprice
  
      if itemnum == 2:
          foodprice = quantity * num2
          Totalprice2 = foodprice
  
      if itemnum == 3:
          foodprice = quantity * num3
          Totalprice3 = foodprice
  
      if itemnum == 4:
          foodprice == quantity * num4
          Totalprice4 = foodprice
  
      if itemnum == 5:
          foodprice = quantity * num5
          Totalprice5 = foodprice
  
      if itemnum == 6:
          foodprice == quantity * num6
          Totalprice6 = foodprice
  
      if itemnum == 7:
          foodprice = quantity * num7
          Totalprice7 = foodprice   
  
      subtotal = Totalprice1 + Totalprice2 + Totalprice3 + Totalprice4 + Totalprice5 + Totalprice6 + Totalprice7 
      billtax = subtotal * tax
      finalbill = subtotal + billtax
      itemnum = input("Enter the item you would like to purchase! ")
      quantity = input("How many of this item do you want?")
  
  print "Your total bill without tax is... ", round(subtotal,2)
  print "Your total tax is... ", round(billtax,2)
  print "Your final bill is... ", round(finalbill,2)
  amtgiven = input ("How much do you want to pay with?")
  change = amtgiven - finalbill
  print "Your change is... ", round(change,2)
  </code></pre>
  
  <h1>second part</h1>
  
  <pre><code>num1 = 4.87
  num2 = 5.03
  num3 = 5.50
  num4 = 9.45
  num5 = 1.29
  num6 = 2.19
  num7 = 2.29
  itemnum = 0
  Subtotal = 0
  tax = 0.0565
  amtgiven = 0
  change = 0
  quantity = 0
  foodprice = 0
  Totalprice1 = 0
  Totalprice2 = 0
  Totalprice3 = 0
  Totalprice4 = 0
  Totalprice5 = 0
  Totalprice6 = 0
  Totalprice7 = 0
  billtax = 0
  finalbill = 0
  change = 0
  customer = 0
  
  print "Welcome to Virtual McDonald's!"   "Would you like to order a food item"
  print "Item:                     Meal/tem:                          Price:"
  print "1                          Big Mac Meal                        4.87"
  print "2                          Quarter Pounder Meal                5.03"
  print "3                          Chicken Nuggets Meal (5 piece)      5.50"
  print "4                          ChickenNuggets Meal (10 piece)      9.45"
  print "5                          Apple Pie                           1.29"
  print "6                          Large Drink                         2.19"
  print "7                          Large Fries                         2.29"
  
  
  customer = raw_input ("Would you like to order? (If not type No)")
  while customer != "No":
  
      while itemnum != -1: 
          itemnum = input("Enter the item you would like to purchase! ")
          quantity = input("How many of this item do you want? ")
  
          if itemnum == 1:
              foodprice = quantity * num1
              Totalprice1 = Totalprice1 + foodprice
  
          if itemnum == 2:
              foodprice = quantity * num2
              Totalprice2 = Totalprice2 + foodprice
  
          if itemnum == 3:
              foodprice = quantity * num3
              Totalprice3 = Totalprice3 + foodprice
  
          if itemnum == 4:
              foodprice = quantity * num4
              Totalprice4 = Totalprice4 + foodprice
  
          if itemnum == 5:
              foodprice = quantity * num5
              Totalprice5 = Totalprice5 + foodprice
  
          if itemnum == 6:
              foodprice = quantity * num6
              Totalprice6 = Totalprice6 + foodprice
  
          if itemnum == 7:
              foodprice = quantity * num7
              Totalprice7 = Totalprice7 + foodprice
  
      itemnum = input("Enter the item you would like to purchase! ")
      quantity = input("How many of this item do you want? ")
      subtotal = Totalprice1 + Totalprice2 + Totalprice3 + Totalprice4 + Totalprice5 + Totalprice6 + Totalprice7 
      billtax = subtotal * tax
      finalbill = subtotal + billtax        
      print "Your total bill without tax is... ", round(subtotal,2)
      print "Your total tax is... ", round(billtax,2)
      print "Your final bill is... ", round(finalbill,2)
      amtgiven = input ("How much do you want to pay with? ")
      change = amtgiven - finalbill
      print "Your change is... ", round(change,2)
      customer = raw_input ("Would you like to order? (If not type No)")
  </code></pre>
  
  <p>#output</p>
  
  <p>When I run the second program this is what outputs:</p>
  
  <pre><code>Welcome to Virtual McDonald's!Would you like to order a food item
  Item:                     Meal/tem:                          Price:
  1                          Big Mac Meal                        4.87
  2                          Quarter Pounder Meal                5.03
  3                          Chicken Nuggets Meal (5 piece)      5.50
  4                          ChickenNuggets Meal (10 piece)      9.45
  5                          Apple Pie                           1.29
  6                          Large Drink                         2.19
  7                          Large Fries                         2.29
  Would you like to order? (If not type No) yes
  Enter the item you would like to purchase! 1
  How many of this item do you want? 2
  Enter the item you would like to purchase! 1
  How many of this item do you want? 4
  Your total bill without tax is...  9.74
  Your total tax is...  0.55
  Your final bill is...  10.29
  How much do you want to pay with? 11
  Your change is...  0.71
  Enter the item you would like to purchase!
  </code></pre>
  
  <p>(After entering a few menu items the program stops running the loop and goes straight to the bill.  Also after the bill it doesn't ask the user if they're is another customer.)</p>
  
  <p>When I run the first part this is what outputs:</p>
  
  <pre><code>Welcome to Virtual McDonald's!Would you like to order a food item
  Item:                     Meal/tem:                          Price:
  1                          Big Mac Meal                        4.87
  2                          Quarter Pounder Meal                5.03
  3                          Chicken Nuggets Meal (5 piece)      5.50
  4                          ChickenNuggets Meal (10 piece)      9.45
  5                          Apple Pie                           1.29
  6                          Large Drink                         2.19
  7                          Large Fries                         2.29
  Enter the item you would like to purchase! 1
  How many of this item do you want?4
  Enter the item you would like to purchase! 2
  How many of this item do you want?1
  Enter the item you would like to purchase! -1
  How many of this item do you want?-1
  Your total bill without tax is...  24.51
  Your total tax is...  1.38
  Your final bill is...  25.89
  How much do you want to pay with? 26
  Your change is...  0.11
  </code></pre>
  
  <p>I want the second part to output what the first part outputted.  Except after it gives the customer his/her change I want it to execute the other loop, therefore asking the user is there another customer.  If the user inputs "yes" then the program will run all over again for another customer.  Only when there is no more customers does the user input "No" to end the program.  (I went to the python shell and copied these output results.  Numbers on the right are the numbers I entered.)</p>