Git Product home page Git Product logo

calculator's Introduction

Calculator

Description

A simple calculator using HTML, SCSS and JavaScript. You can test the calculator at:

https://kris-martin.github.io/calculator/

Calculator UI

Functions

  • +, -, ÷, x operators
  • pressing on/c clears the screen and resets the calculator
  • handles decimals
  • calculates results of operations 2 numbers at a time and updates screen
  • can chain operators together eg. 8 x 8 + 7 - 2 = 69.
    • the calculator first calculates the result of the first 2 numbers, then of the result and the next number and so on...
  • pressing equal returns a result
  • a result is also shown after two numbers are entered with an operator
  • if one number is entered, then an operator, and then equals, it returns the result of: num operator num - eg. if num = 12 and operator = x then it calculates 12 x 12 = 144.
  • formats results to fit within 9 digit display

Limitations

  • can only press equals once.

Future features to implement

  • % button
  • square root button
  • +/- assign positive/negative to number
  • CE button
  • pressing equal again repeats the last operation

Project Brief

MVP

  1. Create a README.md on your Calculator repository that includes a picture of the design you will be reproducing

    Image of calculator to reproduce - source

    Picture of calculator

  2. Using HTML + SCSS, recreate the design that you chose

  3. Create a calculator to be rendered to the html page

  4. it should have number keys from 0 to 9

  5. It should have operator keys (+, -, /, *, =)

  6. It should also have a “.” key

  7. It should have a display rendering the current calculation in a box at the top

  8. Should render the current calculation in a box at the top (calculator display)

  9. It should handle decimals

  10. It doesn’t need to support order of operation

  11. It should not use eval() or Function() constructor

  12. Make sure to keep your functions separated from the JS DOM interaction code.

calculator's People

Contributors

kris-martin avatar

Stargazers

 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.