Question: Write a program using arraylists in java that simulates a vending machine. Products can be purchased by inserting coins with a value at least equal

Write a program using arraylists in java 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.

The program should include a class VendingMachine that is not coupled with the Scanner or PrintStream classes.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!