You have just started as a front-end developer at your new job. Your first project is to make a simple calculator website. Your responsibility is to create the user interface for the calculator code other developers have already written.
You will need to add buttons for the numbers 0-9, each operation (addition, subtraction, multiplication, division, total), and a clear button. You may change the HTML as you need, but there must be a tag with the id screen
to display the output.
You may style the calculator as you see fit, although a grid layout for the buttons is preferred.
You have been provided with the Calculator
object, which has 3 functions, described below. Use jQuery to add click handlers for each button. Each click handler should call the appropriate function. The Calculator
object updates the screen automatically.
Call this for the number buttons 0 through 9.
Example: clicking the number "1" button should call Calculator.number(1);
Call this for the following operations: addition ("+"), subtraction ("-"), multiplication ("*"), division ("/"), or total ("=").
Example: clicking "+" should call Calculator.operation("+");
Call this for operations to reset the calculator
Example: clicking "clear" should call Calculator.clear();