Now that you have learned JavaScript/jQuery 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.
You will create a calculator with JavaScript and jQuery. The HTML for the calculators 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.
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.
[ ]: 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 the necessary calculator buttons are assigned click events which result in some action being performed (be it updating the displayed value, or performing math)
[ ]: Handles decimals
[ ]: Users can enter values/perform math with keyboard input (keypress)