Skip to content

vanessagl2/vending-machine-dojo

Repository files navigation

vending-machine-dojo

This is a DOJO based on the Original Kata available at:

https://github.com/guyroyse/vending-machine-kata

This codebase contains an extension for that DOJO

Vending Machine Description

The goal of this program is to model a vending machine and the state it must maintain during it's operation. How exactly the actions on the machine are driven is left intentionally vague and is up to the implementor. The machine works like all vending machines: it takes money then gives you items.

The vending machine accepts money in the form of some coins: nickels ($0.05), dimes ($0.10), quarters ($0.25), and paper dollars($1). You must have at least have 3 primary items that cost $0.50, $0.65, $1.00. The user may hit a "coin return" button to get back the money they've entered so far. If you put more money in than the item's price, you get change back.

Valid set of actions on the vending machine

  • NICKEL(N: 0.05), DIME(D: 0.10), QUARTER(Q: 0.25), DOLLAR(DO: 1.00) - insert money
  • COIN RETURN - returns all inserted money
  • GET-CHIPS, GET-CANDY, GET-COLA - select item CHIPS ($0.50), CANDY ($0.65), COLA($1), or
  • SERVICE - a service person opens the machine and sets the available change and items

The valid set of responses from the vending machine

  • N, D, Q, DO - return money
  • COLA, CHIPS, CANDY - the items sold

The vending machine must track the following state:

  • available items - each item has a count, a price, and a selector (COLA, CHIPS, CANDY)
  • available change - # of nickels, dimes and quarters available
  • currently inserted money

Features

There are several features and their following inputs and outputs examples. If you want to develop a learning program based on those features please follow.

About

Solution for the Original Kata available at: https://github.com/guyroyse/vending-machine-kata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages