Question: Please write the program in c++ and use vectors and arrays. The beverages will be coke, pesi and sprite. Your program presents the user with
Please write the program in c++ and use vectors and arrays.
The beverages will be coke, pesi and sprite.



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. A service technician enters 0000# from the keypad, your program presents a menu and operates continuously until user exit the menu: 1) Add new beverage 2) Remove beverage 3) Update beverage price A service technician can also reprogram the logical truth values for C1, C2, C3 for any of the favorite beverages. The vending machine can be programed up to 8 favorite beverages for 8 possible truth values for C1, C2, C3. Once the vending machine is programed, your program presents the user with a choice of the 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 = {al, al, a2, a3, a4, a5, a6, a7} such that al, al..., a7 can be any favorite beverages. Let B set of valid user input = {(A, 1), (A, 2), (A, 3), ... (DO)} such that any ordered pair can be re-programed for any of the favorite beverage in set A. Output Input For output Display the drink cost User Input from the keyboard Any element in set B Any element in set B any C1 C2 C3 any 0 0 0 Price is programmable Any any 0 0 1 Price is programmable any 0 1 0 Price is programmable element in set B Any element in set B Any element in set B Any element in set B any 0 1 1 Price is programmable any 1 0 0 Price is programmable Your program should operate continuously with a list of drinks and their costs displayed on screen. Example of the keypad: INSTRUCTIONS 1 For price of desired item press corresponding key A 12 B 13 14 C5 16 D178 # 19 10 Price appears on display 3 Insert coins 4 Make selection on key pad 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. 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. A service technician enters 0000# from the keypad, your program presents a menu and operates continuously until user exit the menu: 1) Add new beverage 2) Remove beverage 3) Update beverage price A service technician can also reprogram the logical truth values for C1, C2, C3 for any of the favorite beverages. The vending machine can be programed up to 8 favorite beverages for 8 possible truth values for C1, C2, C3. Once the vending machine is programed, your program presents the user with a choice of the 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 = {al, al, a2, a3, a4, a5, a6, a7} such that al, al..., a7 can be any favorite beverages. Let B set of valid user input = {(A, 1), (A, 2), (A, 3), ... (DO)} such that any ordered pair can be re-programed for any of the favorite beverage in set A. Output Input For output Display the drink cost User Input from the keyboard Any element in set B Any element in set B any C1 C2 C3 any 0 0 0 Price is programmable Any any 0 0 1 Price is programmable any 0 1 0 Price is programmable element in set B Any element in set B Any element in set B Any element in set B any 0 1 1 Price is programmable any 1 0 0 Price is programmable Your program should operate continuously with a list of drinks and their costs displayed on screen. Example of the keypad: INSTRUCTIONS 1 For price of desired item press corresponding key A 12 B 13 14 C5 16 D178 # 19 10 Price appears on display 3 Insert coins 4 Make selection on key pad 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
