Question
C++ program only Write a C++ program to accomplish the following: Your program presents the user with a choice of your favorite beverages. Then allow
C++ program only
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 inputs. The output which beverage user chooses.
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 inputs. The output which beverage user chooses.
Let A set of favorite beverages = {Coke, Pepsi, Water}.
Let B set of valid user input for above drinks= {(A, 1), (B, 2), (C, 3)}C1, C2, and C3are the logic inputs.
There are 8 possible truth values or 8 digital logics. Only 3 pairs are valid for 3 favorite beverages. The machine can hold maximum10 max drinks for each logic inputs.
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.Array/vector must be used and an expected looping menu-driven of the keypad.
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 inputs. The output which beverage user chooses. Let A set of favorite beverages = {Coke, Pepsi, Water}. Let B set of valid user input for above drinks = {(A, 1), (B, 2), (C, 3)} C1, C2, and C3 are the logic inputs. There are 8 possible truth values or 8 digital logics. Only 3 pairs are valid for 3 favorite beverages. The machine can hold maximum 10 max drinks for each logic inputs. Input/output Table for the vending machine The truth table and The Boolean Expression Corresponding to the Digital Circuit User Output Logic Output For output Input variables Display the drink cost from the keyboard C1 C2 C3 O Invalid 0 0 0 0 Not available selection (A,1) Coke 0 0 1 1 $1.50 Invalid 0 1 0 0 Not available selection (B,2) Pepsi 0 1 1 1 $1.75 Invalid 1 0 0 0 Not available selection (C,3) Water 1 0 1 1 $1 Invalid 1 1 0 0 Not available selection Invalid 1 1 1 0 Not available selection Your program should operate continuously with a list of drinks and their costs displayed on the terminal. Example of the keypad: INSTRUCTIONS 1 For price of desired item press corresponding key 2 Price appears on display 3 Insert coins Make selection on key pad A12 B3 14 ICT5 T6 D17 18 # 19 10 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. Array/vector must be used and an expected looping menu-driven of the keypad. Extra credit: Once a user has selected their drink, the system should allow user 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 machineStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started