Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program to do the following A service technician enters 0000# from the keypad, your program presents a menu and operates continuously until

Write a C++ program to do the following

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 programmed up to 8 favorite beverages for 8 possible truth values for C1, C2, C3. Once the vending machine is programmed, 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 chooses.

Let A set of favorite beverages = {a0, a1, a2, a3, a4, a5, a6, a7}such that a0, a1..., a7 can be any favorite beverages.

Let B set of valid user input = {(A, 1), (A, 2),(A, 3), ... (D0)}such that any ordered pair can be re-programmed for any of the favorite beverage in set A.

Your program should operate continuously with a list of drinks and their costs displayed on screen.

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.

image text in transcribed

image text in transcribedimage text in transcribed

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 = {a0, al, a2, a3, a4, a5, a6, a7} such that a0, 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 any ci C2 C3 any 0 0 0 Price is programmable any 0 0 1 User Input from the keyboard Any element in set B Any element in set B Any element in set B Any element in set B Any element in set B Any element in set B Price is programmable any 0 1 0 Price is programmable any 0 1 1 Price is programmable any 1 0 0 Price is programmable any 0 1 Price is programmable any 1 1 0 Price is programmable Any element in set B Any element in set B Any element in set B any 1 1 1 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 2 Price appears on display 3 Insert coins A Make selection on key pad A1 2 B 13 4 C 5 16 D7 8 # 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

=+What is the road ahead for software engineers?

Answered: 1 week ago

Question

List and explain the steps in the negotiating process.

Answered: 1 week ago

Question

5. What information would the team members need?

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago