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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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));

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
Transcribed Image Text: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
Transcribed Image Text: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
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education