aaronvan icon

Add-on items

aaronvan | PRO | 05/19/18 12:59:35 AM UTC | 0 ⭐ | 514 👁️ | Never ⏰ | []
C# |

1.1 KB

|

None

|

0 👍

/

0 👎

private void radButtonHamburger_CheckedChanged(object sender, EventArgs e)
        {
            BurgerSubTotal();
            tax = TaxRate * subtotal;
            total = subtotal + tax;
            txtSubtotal.Text = subtotal.ToString("C2");
            txtTax.Text = tax.ToString("C2");
            txtOrderTotal.Text = total.ToString("C2");
        }
 
        private void BurgerSubTotal()
        {
            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 extra items */
            subtotal = 6.95;
            if (chkBox0.Checked == true)
                subtotal += 0.75;
            if (chkBox1.Checked == true)
                subtotal += 0.75;
            if (chkBox2.Checked == true)
                subtotal += 0.75;
        }

Comments