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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
icon
Related questions
Question

C++ programming, please follow the flowchart  PLEASE. thank you for helping

#include <iostream>

#include <iomanip>

double

double showMenu();

double takePurchase(double);

double takePayment();

double takePayment();

void displayInfo(double, double);

double showMenu() {}

double takePayment() {

double takePurchase()

 

HOMEWORK 6 PART 2
takePayment
TakePurchase
Date Due: Wednesday, April 21, 2021 at 11:59pm
(Price)
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.
Prompt for
and input
Planning
- Program INPUT PROCESS OUTPUT
payment
Prompt for and
input quantity
Input
Process
Output
1. Product Number
Return
1. Show menu
2. Calculate purchase
3. Take payment
1. Total Purchase
2. Product Quantity
3. Payment Amount
(payment)
2. Tax (6% of
Total Purchase )
3. Change
Return
(price * quantity)
4. Calculate tax
5. Calculate Total
purchase
6. Calculate Change
Planning
- Function Flow Charts
showMenu
Show menu:
1. Coke $1.25
2. Pepsi $1.00
3. Water $2.00
4. Coffee $1.50
5. Exit Menu
return price
Transcribed Image Text:HOMEWORK 6 PART 2 takePayment TakePurchase Date Due: Wednesday, April 21, 2021 at 11:59pm (Price) 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. Prompt for and input Planning - Program INPUT PROCESS OUTPUT payment Prompt for and input quantity Input Process Output 1. Product Number Return 1. Show menu 2. Calculate purchase 3. Take payment 1. Total Purchase 2. Product Quantity 3. Payment Amount (payment) 2. Tax (6% of Total Purchase ) 3. Change Return (price * quantity) 4. Calculate tax 5. Calculate Total purchase 6. Calculate Change Planning - Function Flow Charts showMenu Show menu: 1. Coke $1.25 2. Pepsi $1.00 3. Water $2.00 4. Coffee $1.50 5. Exit Menu return price
displaylnfo
(purchase, payment)
Sample outputs from Homework #6 Part 2
HOMEWORK #6 PART 2
**** Vending Machine ****
Calculate tax
1. Coke $1.25
2. Pepsi $1.00
3. Water $2.00
4. Coffee $1.50
5. Exit Menu
(6% of purchase)
Calculate total purchase
(purchase + calculated tax)
Enter your choice: 1
How many do you want? 1
How much is your payment? $2
Tax Amount: $0.07
Total Purchase: $1.32
Change: $0.68
Calculate change
Programmer: insert your name here
(payment – total purchase)
HOMEWORK #6 PART 2
**** Vending Machine ****
Display
1. Coke $1.25
2. Pepsi $1.00
3. Water $2.00
4. Coffee $1.50
5. Exit Menu
calculated values
Enter your choice: 2
How many do you want? 2
How much is your payment? $10
Return
Code this program using the 4 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
Tax Amount: $0.12
Total Purchase: $2.12
Change: $7.88
continue,
break-except in switch.) Upload to Blackboard: HW6Part2.cpp
Programmer: insert your name here
Transcribed Image Text:displaylnfo (purchase, payment) Sample outputs from Homework #6 Part 2 HOMEWORK #6 PART 2 **** Vending Machine **** Calculate tax 1. Coke $1.25 2. Pepsi $1.00 3. Water $2.00 4. Coffee $1.50 5. Exit Menu (6% of purchase) Calculate total purchase (purchase + calculated tax) Enter your choice: 1 How many do you want? 1 How much is your payment? $2 Tax Amount: $0.07 Total Purchase: $1.32 Change: $0.68 Calculate change Programmer: insert your name here (payment – total purchase) HOMEWORK #6 PART 2 **** Vending Machine **** Display 1. Coke $1.25 2. Pepsi $1.00 3. Water $2.00 4. Coffee $1.50 5. Exit Menu calculated values Enter your choice: 2 How many do you want? 2 How much is your payment? $10 Return Code this program using the 4 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 Tax Amount: $0.12 Total Purchase: $2.12 Change: $7.88 continue, break-except in switch.) Upload to Blackboard: HW6Part2.cpp Programmer: insert your name here
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning