The vending machine program is mini capstone project that I created at Tech Elevator, the coding bootcamp that I attended. The program stocks the vending machine via text file. In this case it is the VendingMachine.csv.
- The vending machine needs to dispense 4 types of food: candy, chips, drinks, and gum.
- A main menu should display when the menu is running and display the following items.
- Display Vending Machine Items
- Purchase
- The vending machine should stock its inventory from a text file.
- the vending machine is restocked every time the application is run.
- When the customer selects (1) Display Vending Machine Items they are presented a list of all items in the vending machine with its quantity remaining.
- Each vending machine product has a slot identifier and a purchase price.
- Each slot in the vending machine has enough room for 5 of that product.
- Every product is initially stocked to the maximum amount.
- A product which has run out should indicate it is SOLD OUT
- When the customer selects (2) Purchase they are guided through the purchasing process menu:
- Feed Money
- Select Product
- Finish Transaction
- This menu should also display the money that has already been input.
- The purchase process flow is as follows:
- Selecting (1) Feed Money A customer can repeatedly feed money into the machine in whole dollar amounts (e.g. $1, $2, $5, $10).
- The current money provided indicates how much money the customer has fed into the machine
- Selecting (2) Select Product allows the customer to select a product to purchase.
- If the product code does not exist, the customer is informed and returned to the Purchase menu.
- If a product is sold out, the customer is informed and returned to the Purchase menu.
- If a valid product is selected it is dispensed to the customer.
- After the product is dispensed, the machine should update its balance accordingly and return the customer to the Purchase menu
- Selecting (3) Finish Transaction allows the customer to complete the transaction and receive any remaining change back.
- The customer’s money is returned using nickels, dimes, and quarters (using the smallest amount of coins possible).
- The machine’s current balance should be updated to $0 remaining.
- i. The item(s) will be “consumed” and a message printed depending on the item type:
- All chip items will return “Crunch Crunch, Yum!”
- All candy items will return “Munch Munch, Yum!”
- All drink items will return “Glug Glug, Yum!”
- All gum items will return “Chew Chew, Yum!”
- Selecting (1) Feed Money A customer can repeatedly feed money into the machine in whole dollar amounts (e.g. $1, $2, $5, $10).
- All purchases must be audited to prevent theft from the vending machine
- Each purchase should generate a line in a file called Log.txt
- b. The audit entry should be in the format:
01/01/2016 12:00:00 PM FEED MONEY: $5.00 $5.00
01/01/2016 12:00:15 PM FEED MONEY: $5.00 $10.00
01/01/2016 12:00:20 PM Crunchie B4 $10.00 $8.50
01/01/2016 12:01:25 PM Cowtales B2 $8.50 $7.50
01/01/2016 12:01:35 PM GIVE CHANGE: $7.50 $0.00
- There should be unit tests in place in order to test the program.