Question: Write a C++ code Develop a program working as a soda vending machine. The program should show the product menu with price and take user

Write a C++ code

Develop a program working as a soda vending machine. The program should show the product menu with price and take user input for product number, quantity and pay amount. The output should show the total sale price including tax and the change.

Planning - Program INPUT PROCESS OUTPUT

Input

Process

Output

  1. Product Number
  2. Product Quantity
  3. Payment Amount
  1. Show menu
  2. Take purchase information
  3. Take payment
  4. Calculate Amount
  5. Calculate Change
  1. Sale Price
  2. Tax
  3. Total Purchase Amount
  4. Change

Code this program using the 5 functions indicated by the flowcharts. Use the tax rate as 6% (0.06). Be sure your code is structured (only one return in each function, no exit, or continue, or breakexcept in switch.)

SAMPLE OUTCOME

WORKING WITH FUNCTIONS

1. Coke $1.25

2. Pepsi $1.00

3. Water $2.00

4. Coffee $1.50

5. Exit Menu

Please enter the number of your choice from the menu 3

Please enter the number of this drink you want 2

Please enter the payment amount $10

The total amount of the purchase, including tax = $4.24

The amount of payment = $10

The amount of change returned = $5.76

Programmer(insert your name here)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!