GithubHelp home page GithubHelp logo

class_calculator_2022's Introduction

Calculator DOM Exercise

Clone this repository to your local machine

  • git clone https://github.com/vlino2015/calculator.git
  • cd into the calculator directory
  • work with your classmates to build a calculator
  • hint1: Don't place an event listener on each individual button. Instead, use addEventListenter and attach a listener to a group of buttons. Use the event object to determine which button was clicked.
  • hint: use slice and splice instead of push and pop

Create a Calculator using HTML/CSS/JS

  1. Add click handlers to the number buttons
    • Create an array of the numbers clicked, in order
  2. Add click handlers to the calculation buttons
    • Create an array of the operators
    • Don't let a user start with an operator
    • Don't let a user type multiple operators (i.e. you can't type '--' or '++' or "*+")
  3. Add click handler to the 'equals' button
  4. The 'equals' button needs to trigger a few events (NOTE: These will be functions)
    • Loop through the array of numbers (NOTE: These are currently strings)
    • Convert the strings to integers (TODO: probably want to convert to float?)
    • Write a new array of integers
    • Get an array of the operators
    • Perform each math operation (NOTE: We'll use 4 while loops)
  5. Add click handler clearing the input on press of clear

class_calculator_2022's People

Contributors

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