Question: Done in Java. I would appreciate any help as I don't understand Java well. Part2: Vending Machine Write a program that simulates a vending machine.
Done in Java. I would appreciate any help as I don't understand Java well.
Part2: Vending Machine Write a program that simulates a vending machine. Products can be purchased by inserting coins with a value at least equal to the cost of the product. A user selects a product from a list of available products, adds coins, and either gets the product or gets the coins returned. The coins are returned if insufficient money was supplied or if the product is sold out. The machine does not give change if too much money was added. Products can be restocked and money removed by an operator. Follow the design process that was described in Chapter 12. Your solution should include a class Vending Machine that is not coupled with the Scanner or PrintStream classes. Include any additional classes as needed. Also, create a class Item that has the name, option_number, price, quantity, etc. for each item. Maintain a list of Items in the vending machine. Write a method buy that lets a user select a product from the displayed list, and lets them add money. Update the quantity whenever an item is purchased. You should also write operator methods that can be used to restock/add items, view the cash balance, remove the money, etc. Design (CRC Cards, UML diagrams), implement and test your program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
