I need to write a program that accepts coins(nickles, dimes, quarter) and single dollar bills, dispenses the item and returns change if the deposited money exceeds the item's value.
There are 5 items with the prices of: 65 cents, 95 cents, 50 cents, 110 cents and 75 cents. There is more that needs to be done with LED lights and the machine breaking but I'm stuck with how to initialize these and have the user input the coins and it dispense. HELP!
This is all I have so far:
class VendingMachine {
public class VendingMachine{
private int itemPrice;
private int balance;
private int totalCollected;
public VendingMachine(int itemCost){
itemPrice = itemCost;
balance = 0;
totalCollected = 0;
}