So the problem I have to do is create a fast food-ordering program that calculates the cost including taxes (7.5%). Using a while or do-while loop and switch statement and don't get those very well yet. Below is more of what the menu for ordering should look something like and should repeat showing itself until the order is finished: Model Hall Fast-Food 1) Add one hamburger ($4.99) 2) Add one order of fries ($2.49) 3) Add one drink ($.99) 4) Done with Order -------------------------------------------- Your order total including tax = $ _________ Please enter an option from the menu: The order total is given every time. When option 4 is selected, the program thanks the user and exits. Any help with coding it in C++ would be very much appreciated.
So the problem I have to do is create a fast food-ordering program that calculates the cost including taxes (7.5%). Using a while or do-while loop and switch statement and don't get those very well yet. Below is more of what the menu for ordering should look something like and should repeat showing itself until the order is finished:
Model Hall Fast-Food
1) Add one hamburger ($4.99)
2) Add one order of fries ($2.49)
3) Add one drink ($.99)
4) Done with Order
--------------------------------------------
Your order total including tax = $ _________
Please enter an option from the menu:
The order total is given every time.
When option 4 is selected, the program thanks the user and exits.
Any help with coding it in C++ would be very much appreciated.
Step-1: Start
Step-2: Declare an int variable choice
Step-3: Declare an bool variable point with initial value 'true'
Step-4: Declare a float variable totalCost with initial value 0.0
Step-5: Start a do-while loop until point != false
Step-5.1: Print
Model Hall Fast-Food
1) Add one hamburger ($4.99)
2) Add one order of fries ($2.49)
3) Add one drink ($.99)
4) Done with Order
--------------------------------------------
Your order total including tax = $ _________
Please enter an option from the menu:
Step-5.2: Take input from user and store in choice
Step-5.3: switch statement(choice)
Step-5.3.1: case 1: calculate totalCost and break
Step-5.3.2: case 2: calculate totalCost and break
Step-5.3.3: case 3: calculate totalCost and break
Step-5.3.4: case 4: Print Thanks for order and set point = false
Step-5.3.5: default: Print Wrong Choice
Step-5.4: end switch
Step-6: end do-while
Step-7: Stop
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images