Advertisement
aaronvan

Adding some items

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