Giter Site home page Giter Site logo

vendotron's Introduction

VendoTron

Vending Machine coding challenge

Running

Clone this repo, and from its root dir:

$ ruby cli.rb

Screenshots

Screen Shot 2020-08-07 at 2 59 46 PM

Specs

Provide the functional design of software that controls a Vending Machine. The Vending Machine has a predefined set of items that the user can purchase using cash. The vending machine has the following actions:

  • User inserts cash
  • User selects item
  • Item is dispensed if enough money has been inserted
  • Change is dispensed
  • Coin denominations accepted:
    • Quarter = 25 cents
    • Dime = 10 cents
    • Nickel = 5 cents
    • Penny = 1 cent

The first two actions shoud be allowed in any imaginable order, for example:

  • User may select item first, then insert enough coins to dispense it.
  • User may insert enough coins, then select an item.
  • ๐Ÿ‘† And any combinations of these 2 actions.
    • If they select a different item after they've already inserted some coins, the "Sale Price" should change to that item. They should be required to insert that much money. They can select a different item as many times as they want.

Your Task

  1. Write a program that emmulates the Vending Machine.
  2. Choose whatever input method you prefer. CLI is fine, or simulated input from a Test.
  3. Implement a method dispense_change()

vendotron's People

Contributors

rbrooks avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.