GithubHelp home page GithubHelp logo

code-alchemist-arch / beverage-vending-simulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smmehrab/coffee-vending-machine

0.0 0.0 0.0 291 KB

A Beverage vending machine simulator program, implemented to showcase the State Design Pattern in action.

License: Apache License 2.0

Java 100.00%

beverage-vending-simulator's Introduction

Coffee Vending Machine

A coffee vending machine simulator program, implemented to showcase the State Design Pattern in action.

This is a weekly lab assignment belonging to CSE-3216 (Software Design Patterns Lab).


A Coffee Vending Machine Illustration


Problem

You have to implement a coffee vending machine. Coffee machine works as follows:

  • Machine accepts only coins of 10, 20 and 50 cents worth.
  • Machine can prepare two types of drinks: Coffee and Cappuccino.
  • Coffee is 1.20 and Cappuccino is 1.50.
  • You can insert money and eject inserted money.
  • When you select a beverage by pressing corresponding button, if there is not enough money, it gets ejected automatically.
  • In case if there was enough money, the change should be returned and beverage should be prepared.
  • When beverage is ready machine waits for the cup to be taken and only then you can make next order.

Your task is to implement coffee vending machine simulator program. You may assume that there are at most 5 cups of each beverage and after it runs out, you won’t be able to buy it anymore. The remaining money after buying a drink should be returned in coins of 10, 20 and 50 cents worth.


Design

Possible states of the coffee vending machine are visualized below:

States of the Machine

More detailed documentation will be added later. Moreover, I hope to make further changes to this repository in future.

beverage-vending-simulator's People

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.