const double TaxRate = 0.0775;
static double subtotal;
static double tax = (TaxRate * subtotal);
static double OrderTotal = subtotal + tax;
private void radButtonHamburger_CheckedChanged(object sender, EventArgs e)
{
subtotal = 0.0;
txtSubtotal.Clear();
chkBox0.Checked = false;
chkBox1.Checked = false;
chkBox2.Checked = false;
lblAddOnItems0.Text = "Lettuce, tomato, and onions";
lblAddOnItems1.Text = "Ketchup, mustard, an mayo";
lblAddOnItems2.Text = "French fries";
grpBoxAddOnItems.Text = "Add-on items($.75/each)";
/* add the main course */
subtotal += 6.95;
/* add the extra items */
if (chkBox0.Checked)
subtotal += 0.75;
if (chkBox1.Checked)
subtotal += 0.75;
if (chkBox2.Checked)
subtotal += 0.75;
}
Comments