Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Explain the fi ve most important physical distribution activities.

Answered: 1 week ago