程序代写代做 c++ Lab 2 Vending Machine

Lab 2 Vending Machine
Write a C++ program to accomplish the following:
Your program presents the user with a choice of your favorite beverages. Then allow the user to choose a beverage by entering a pair of input. The output which beverage user choses.
Let A set of favorite beverages = {Coke, Pepsi, Water}. Let B set of valid user input = {(A, 1), (B, 2), (C, 3)}
Input/output Table for the vending machine
The truth table and The Boolean Expression Corresponding to a Circuit
User Input from the keyboard
Output
Input
Output
For output Display the drink cost
C1
C2
C3
O
Invalid selection
0
0
0
0
Not available
(A,1)
Coke
0
0
1
1
$1.50
Invalid selection
0
1
0
0
Not available
(B,2)
Pepsi
0
1
1
1
$1.75
Invalid selection
1
0
0
0
Not available
(C,3)
Water
1
0
1
1
$1
Invalid selection
1
1
0
0
Not available
Invalid selection
1
1
1
0
Not available
Your program should operate continuously with a list of drinks and their costs displayed on screen.
Example of the keypad:
1

Lab 2 Vending Machine
Once a user has selected their drink the system should allow them to enter the amount of money they are inserting into the machine. The program should then calculate the amount of change to be returned and subtract one from the number of the drink in the machine. If the user selects a drink which has sold out an appropriate message should be displayed. Some input validation should be carried out on the selection from the true table.
Arrays must be used and an expected looping menu-structure of the keypad.
Once a user has selected their drink the system should allow users to enter the amount of money they are inserting into the machine. The program should then calculate the amount of change to be returned from the machine.
2