<− back to schedule
csci 20 :: project 3


Write a Ruby program that does the following:

  1. (50 pts) includes project name, file name, and programmer name in comments at the top
  2. (50 pts) has neat and consistent formatting and naming
  3. (50 pts) has a loop that keeps the program repeating until the user chooses to exit
  4. (50 pts) uses at least one array
  5. (50 pts) uses at least one hash
  6. (500 pts) implement a 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

Starter/helper files:

Turn-in instructions:

When you are done email your source file (.rb) to jboydt@foobt.net.

Deadline is midnight, fri, nov 30 (50 points deducted each 24 hours past the deadline).