If you check both Regular and Cheese Menu Burgers Fries Drinks Choices for Burgers Regular (4.19) w/Cheese (4.79) w/ Bacon (4.79) w Bacon and Cheese (5.39) Compute Cost of Meal Total Quantity 1 2 Tax If you want to cancel Regular, you can uncheck Regular and quantity will be cleared automatically. Menu Choices for Burgers х Burgers Fries Drinks Regular (4.19) w/Cheese (4.79) w/ Bacon (4.79) w Bacon and Cheese (5.39) Quantity 2 Compute Cost of Meal Tax Total If you click on the Compute Button, Calculate Cost of Meal, Tax, and Total • Tax is 9% of the Cost of Meal. • Total is the Cost of Meal Plus the Tax. Burgers Menu Choices for Burgers Regular (4.19) w/Cheese (4.79) Quantity w/ Bacon (4.79) 2 w Bacon and Cheese (5.39) 1 Choice for Fries Fries Quantity Small (2.39) 1 Medium (3.09) 2 Drinks Large (4.99) Choice for Drinks Soda (1.69) Bottled Water (1.49) Quantity 2 Compute Cost of Meal $26.52 Tax $2.39 Total $28.91
Hello! I need your help. Got a lab which is not getting solved. I have a task to make a windows form app using C# for ordering fast food. I got the whole thing working except the part where the custumer can choose the quantity. Attaching bellow what professor is looking for and parts of my code to explain what I have done.
// Getting the order and quantity (where I messed up most likely)
// chkBurger - check box for burger option | txtRegQuant - text box for input
double price = 0.0;
double total = 0.0;
if (chkBurger.Checked)
{
if (chkRegular.Checked)
{
int regQuant = int.Parse(txtRegQuant.Text);
if (regQuant >= 0)
{
price = 4.19 + price;
total = price * regQuant;
}
}
// Final calculation & Output
double taxes = total * 0.09;
double totalTax = total + taxes;
txtTotal.Text = "$" + Convert.ToString(Math.Round(totalTax, 2));
txtCost.Text = "$" + Convert.ToString(Math.Round(total, 2));
txtTax.Text = "$" + Convert.ToString(Math.Round(taxes,2));
Unlock instant AI solutions
Tap the button
to generate a solution