Advertisement
aaronvan

Add-on items

May 18th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. private void radButtonHamburger_CheckedChanged(object sender, EventArgs e)
  2.         {
  3.             BurgerSubTotal();
  4.             tax = TaxRate * subtotal;
  5.             total = subtotal + tax;
  6.             txtSubtotal.Text = subtotal.ToString("C2");
  7.             txtTax.Text = tax.ToString("C2");
  8.             txtOrderTotal.Text = total.ToString("C2");
  9.         }
  10.  
  11.         private void BurgerSubTotal()
  12.         {
  13.             txtSubtotal.Clear();
  14.             chkBox0.Checked = false;
  15.             chkBox1.Checked = false;
  16.             chkBox2.Checked = false;
  17.  
  18.             lblAddOnItems0.Text = "Lettuce, tomato, and onions";
  19.             lblAddOnItems1.Text = "Ketchup, mustard, an mayo";
  20.             lblAddOnItems2.Text = "French fries";
  21.             grpBoxAddOnItems.Text = "Add-on items($.75/each)";
  22.  
  23.             /* add the extra items */
  24.             subtotal = 6.95;
  25.             if (chkBox0.Checked == true)
  26.                 subtotal += 0.75;
  27.             if (chkBox1.Checked == true)
  28.                 subtotal += 0.75;
  29.             if (chkBox2.Checked == true)
  30.                 subtotal += 0.75;
  31.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement