Code Monkey home page Code Monkey logo

vendingmachine's Introduction

VendingMachine

Designing and Coding a Vending Machine using Object Oriented Programming with the help of Hello Code's article on Designing a Vending Machine in Java

General Steps

  1. Vending Machine displays a welcome message (products and prices)
  2. It asks the User to select a product
  3. Machine asks the user to enter coins (5, 10, 20, 50, or 100 cents)
  4. Machine calculates and totals up the amount enter by user
  5. It calculates the change based off the total and price of selected product
  6. It calculates minimum number of coins to return
  7. It displays a message with the change amount and coins

Diagram (classes, interfaces, and enums)

Diagram

Flow Chart based off of article's flow chart

FlowChart

Classes

  • Main
  • Vending Machine
  • Coin
    • Accepting 5 different coins: 5 cents, 10 cents, twenty cents, fifty cents, hundred cents
  • Product
    • Representing the different products in our vending machine
  • Calculator
  • CoinBundle
    • Help us return the change; if we need to return 2 10 cents, then we can have [0, 2, 0, 0, 0]; 5 fields for every different coin

Resources

  1. Designing a Vending Machine in Java
  2. Resource on creating diagrams

vendingmachine's People

Contributors

juliuscecilia33 avatar

Watchers

 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.