Question: vending machine assignment please help Write a C++ (or Java, etc.) program to accomplish the following: Your program presents the user with a choice of

vending machine assignment please help vending machine assignment please help Write a C++ (or Java, etc.) program
to accomplish the following: Your program presents the user with a choice

Write a C++ (or Java, etc.) 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 Input Output For output Display the drink cost Output User Input from the keyboard Not av Not available (A,1) 0 Not available (B,2) ci C2 C3 0 Invalid 000 0 selection Coke 0 0 1 1 Invalid 10 0 selection Pepsi OT11 Invalid 1 0 0 0 selection Water 101 Invalid 110 0 selection Invalid 111 0 selection $1.75 Not available $1 Not available Not available Your program should operate continuously with a list of drinks and their costs displayed on screen. Example of the keypad: INSTRUCTIONS A 12 B 34 C 56 D 78 # 9 10 I cons 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. Extra credit: 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

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 Databases Questions!