/Calculator

Week 3 project

Primary LanguageHTML

Build a Calculator  

This exercise will help you understand how to use JavaScript functions and algorithms. You will also work with the DOM and respond to user input.

Step 1: Set up your project

Create an index.html file
Create a main.css file and link it to your index.html file
Create a main.js file and link it to your index.html file
Step 2: Build the HTML

Using the mockup provided, create your HTML

Step 3: Apply the Styles

Author CSS to match your HTML page to the mockup below.

Step 4: Write the JavaScript

Writing the JavaScript and interacting with the DOM is the main part of the project
Start small by selecting some elements
What algorithms do you need to implement?
Create some functions to store repeatable steps
You'll need to find a way to track the numbers pressed until the = is pressed
No need for chaining long calculations yet (see hard mode)

Step 5: Submit Completed Assignment

This project should be on your Github Account
Please submit the project with a URL to your Github project

Hard Mode  

You should find the above project challenging, however here are extra features you should attempt to add in.

Chain complex calculations.
Ex: 5 + 5 - 4 / 10

Take into account order of operation
You'll need a way to manage state if you do this
Add a button to calculate the Modulo of 2 numbers
Add a button to calculate the Square Root of 2 numbers
Add a decimal button
Keep track of all the calculations so that you can scroll back through them