Question: Extra Credit Assignment Objective: Create a program that simulates the operation of a Vending Machine. Your program should allow users to select one or more
Extra Credit Assignment Objective:
Create a program that simulates the operation of a Vending Machine. Your program should
allow users to select one or more items and make purchases. Your program must assume that
the user can only insert quarters or dollars; therefore, your program should handle
accumulating the inserted amount until the purchase is made and provide the appropriate
amount of change based on the total amount purchased and the amount of money inserted
Requirements:
Must use arrays to store the items available in the vending machine and their corresponding
prices. Must implement functions to handle item selection, display available items, calculate
total cost, and handle the purchase transaction.
Must use appropriate function prototypes and pass necessary arguments to functions.
Must use appropriate variable types according to the values it will hold
User interface: Must display appropriate messages on the screen to display the available items
and their prices, prompt the user with and obtain their input selection and inserted money
must display messages to confirm selection, display current amount collected based on money
deposited and display if any change is being dispensed along with the products
Grading: Your program will be graded based on the following criteria:
Correctness of the program's logic in executing the objective outlined above
Program follows the required interface specification
Source code is well documented with programmer information
Uses functions to appropriately achieve the tasks including:
display the available items and their prices
allow users to select an item from the array
calculate the total cost of selected items
handle the purchase transaction, considering the user's input and available
balance
Continuously display the menu and prompt the user until they decide to exit or when the
balance is insufficient
Validate the user's input for item selection, quantity, and amount inserted
Implement error handling to manage scenarios where the user enters invalid input,
insufficient balance, or incorrect coin values.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
