JS Calculator

Introduction

Now that you have learned JavaScript syntax and been given an introduction to how JavaScript is used in the browser, it is time to apply your skills and get some experience using 'vanilla' JavaScript to create a user interface.

Overview

You will create a calculator with JavaScript. Your calculator should be added to the DOM on page load entirely with JavaScript (you shouldn't type any HTML to represent your calculator ** you can create a container div if you wish **).

Grading

As usual this is going to be a pass fail assignment. If your program meets all the listed requirements, you will receive a 1 on the assignment. If you fail to do so, you will receive a 0 and have until the following Monday to complete the program for .5 credit.

Minimum Requirements

[ ]: The calculator has a screen which displays numbers input by the user, or a summed total based on mathematical operations

[ ]: The calculator has buttons (0-9, +, -, /, *, ., =, C)

[ ]: The calculator can perform the following operations (i.e. is a working calculator:

  • addition
  • subtraction
  • division
  • multiplication

[ ]: The 'C' button clears the running total/entered value (works like a clear button).

[ ]: = returns the sum of the current operation

[ ]: All calculator buttons are assigned click events which result in some action being performed (be it updating the displayed value, or performing math)

Stretch Goals

[ ]: Handles decimals

[ ]: Users can enter values/perform math with keyboard input (keypress)