avaScript: Use any of the techniques (including jQuery if you would like to). Be sure to upload your html, js, and css/jquery files if used
JavaScript: Use any of the techniques (including jQuery if you would like to). Be sure to upload your html, js, and css/jquery files if used.
/*
* Your task is to create a calculator. You can create
* your calculator using any of the DOM manipulation
* techniques. Use javascript's eval function to perform the calculation.
* If an error occurs, show ERROR on the calculator
* 'screen'.
*
* Example of using eval: var result = eval('10+4*2');
*
* Requirements:
* - Buttons for every digit 0-9
* - Buttons for +, -, /, *
* - Button to backspace or clear <-
* - Button to execute calculation =
* - Calculator 'screen' should update as buttons
* are pressed including numbers, operations, etc
* - Result should show on calculator 'screen'
* - Upon submitting and showing result, calculator
* should reset on next button click, starting new
* calculation
* - If an error occurs, for example inputting ---6,
* calculator 'screen' should output 'ERROR'
* - Calculator 'screen' should fit at least 10
* characters
* - At least 12 CSS styles
*
* Submit your JS file, HTML file, and CSS/jquery
* file.
*/
Refer to the instructions and images:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images