Vending Machine Simulaition Develp a program that will simul
Vending Machine Simulaition
Develp a program that will simulate the operation if vending machine. The machine shoyld sell items and return appropriare changes if needed.
Initally, the machine should ask the user how many items of each type if shpuld hold. The machine should also have a change maker containing nickels(10), dimes(5) and quarters(25). At the begining the user should be asked to specifiy how many of each type of coin the change maker should contain. The program should show the list of available items with thier prices. if the machine is out of any itemsit sould shoer \"OUT\" for the price of that item. The machine should then ask the user to insert money in the form if a dollar bill or quarters,dimes, and nickels and ask for the number of item desierd. if the money inserted was less than the user requested an invalid item, the money should be returned with an appropriate error meggae and the process should start over from the begining . otherwise , the machine should dispense the item togather with any appropriate change. in making , the machine should use as few coins as possible. at the end of the program run, the program should indicate how many of each of the items begin sold remain in the machine and how many dollars , quarters, dimes, and nickels are in the change.
1- Identify the main functional requiremts of the vending machine,. For each identified function, list the input, outputs and presonditions.
Solution
Functional Requirements:-
The main functional requirement is the CASH i.e. It considers the money which is accepted by the machine such as cash in dollors etc or in change like dims,quarters e.t.c .
For this the precondition would be machine should show the user the accepted denomination and the inputs which takes is the paper denomination or change denomination and the output would be the accepted if correct or not acccepted if wrong.
