Skip to content

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 creating a user interface.

Overview

You will create a calculator with JavaScript. The HTML for the calculator's necessary parts has been provided to you in the index.html file. You are adding code to the public/calc.js file that will dictate the functionality associated with a calculator.

resources/

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 class day 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 result of the current operation.

[ ]: All the necessary 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).


Up