Question: Your program will simulate the operation of a vending machine. The machine will dispense, upon reception of the correct amount of money, a choice of
Your program will simulate the operation of a vending machine. The machine will dispense, upon reception of the correct amount of money, a choice of Gum, Peanuts, Cheese Crackers, or M&Ms. Your software will perform the following:
Display a welcome message and instructions.
Set the initial inventory to two (2) of each kind.
Prompt the user for item selection. Gum (G), Peanuts (P), Cheese Crackers (C), or M&Ms (M). Reject any invalid selections.
Confirm the customers selection.
Prompt the user for the amount to enter: Gum ($0.50), Peanuts ($0.55), Cheese Crackers ($0.65), or M&Ms ($1.00).
Accept money inputs of dimes (D), quarters (Q), and one-dollar bills (B).
If the customer selects an out of inventory item, prompt them to make another selection.
Vending machine will shut down if the entire inventory reaches zero.
Assume there is no limit on the amount of change the vending machine contains.
Make provisions for a secret code that when entered will display the current inventory of items.
Sample Processing
Welcome to Mr. Zippys vending machine.
Cost of Gum ($0.50), Peanuts ($0.55), Cheese Crackers ($0.65), or M&Ms ($1.00).
Enter item selection: Gum (G), Peanuts (P), Cheese Crackers (C), or M&Ms (M)
C
You selected Cheese Crackers. Is this correct (Y/N)?
Y
Enter at least 65 cents for selection.
Dimes (D), Quarters (Q) and dollar bills (B):
B
Enough money entered.
Cheese Crackers have been dispensed.
Change of 35 cents has been returned. Enter item selection: Gum (G), Peanuts (P), Cheese Crackers (C), or M&Ms (M)
can you write arm assembly code for it. the code should work on raspberry pi. I want the code please provide the arm assembly code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
