Create vending machine simulator

Question # 40314
  • Computer Science
    3 months ago

    Create vending machine simulator:
    minimum of five (5) products, each with name/price/quantity in stock
    menu that displays items (name/price/quantity in stock) AND an option to exit the program
    allows the user to select an in-stock item for purchase (or to exit)
    collects payment (in whole-number "credits", NOT floating-point currency values) for the item
    displays a breakdown of change to be given (in quarters/dimes/nickels/pennies)
    keeps a history of all items purchased, including name/quantity purchased/total amount
    decrements the quantity of the item purchased from stock
    on exit, displays the history of purchases

    *has a loop that keeps the program repeating until the user chooses to exit
    *uses at least one array
    *uses at least one hash