Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
image text in transcribed
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

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

In problem, find f (x) and simplify. f(x) = (x2 - 4)(x2 + 5)

Answered: 1 week ago

Question

=+ (c) Show by example that f need not be constant.

Answered: 1 week ago

Question

$680 is STILL NOT a correct answer!!!

Answered: 1 week ago

Question

Draw a picture consisting parts of monocot leaf

Answered: 1 week ago

Question

Explain basic guidelines for effective multicultural communication.

Answered: 1 week ago

Question

Identify communication barriers and describe ways to remove them.

Answered: 1 week ago

Question

Explain the communication process.

Answered: 1 week ago