Code Monkey home page Code Monkey logo

calculator's Introduction

calculator implementing OOP and SOLID principles

#functions for all the basic math operators typically found on simple calculators

# operators:
 Add
 subtract
 multiply
 divide

#Function #operate that takes an operator and 2 numbers then calls one of the above functions on the numbers

#function that populates the display

#store the first number that is input into the calculator when a user presses an operator

#save which operation has been chosen and #operate() on then when the equal sign is pressed

#display is populated and updated with the solution to the operation once #operate() has been called

Tests to pass

   # Users being able to string together several operations and get the right answer with each pair of numbers being evaluated at a time eg 12+7-5*3=42;

   # Not evaluate more than a single pair at a time

   # round numbers with long decimals

   # pressing equal sign before entering the numbers or operator should show an error

   # pressing #clear should wipe out any existing data and the user is starting afresh

   # display an error when a user decides to divide by zero

   #decimals....

   #backspace button so the user can undo if they click the wrong number.

calculator's People

Contributors

alwoch 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.