Coder Social home page Coder Social logo

calculator-javascript's Introduction

calculator-javascript

A calculator app using vanilla JavaScript, HTML, and CSS

The calculator contains functions for all of the basic math operators typically found on basic calculators.

  • (1) Created functions for the following items: addition, subtraction, multiplication, and division.
  • (2) Created a function that takes an operator and 2 numbers and then calls one of the above functions on the numbers.
  • (3) Created a basic HTML calculator with buttons for each digit, each of the above functions, an “equals” key, a "clear" key, and a display.
  • (4) Created functions that populate the display when a user clicks the number buttons. The display value is stored in a variable for use in the next step.
  • (5) Stored the first number input into the calculator when a user presses an operator, saved the operation selected, called the operate() function on the values (input and operator) when the user presses the “equals” key, and then updated the display with the solution to the operation.
  • (6) Created the logic that stores all of the values and calls the operate() function - the calculator evaluates a single pair of numbers one at a time.
  • (7) Created error message when user attempts to perform invalid operations (e.g., dividing by 0).
  • (8) Created function that clears the operation once the solution is displayed.
  • (9) Added a "period" key in order to use decimals for one single place value.
  • (10) Added a "backspace" button in order for users to edit any errors.

calculator-javascript's People

Contributors

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