Question: PLEASE USE JAVA! Problem B (20 pts.) Write a program VendingChange. java that determines the change to be displayed from a vending machine. An item
PLEASE USE JAVA!

Problem B (20 pts.) Write a program VendingChange. java that determines the change to be displayed from a vending machine. An item in the vending machine can cost between 25 cents and a dollar in 5cent increments (25,30,35.,90,95 or 100), and the machine accepts only a single dollar bill to pay for the item. The machine then dispenses the change in as few coins as possible. The following interaction shows the output when the user buys an item for 45 cents. Assume that the input to the program is always correct, that is, it lies within the 25 and 100 (inclusive), and is also a multiple of 5. Input cmd: java VendingChange 45 Output: You bought an item for 45 and gave me a dollar, so your change is 2 quarters, dimes, and 1 nickel
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
