To complete this assignment you must --
- Email your instructor what you have completed. You can get partial credit even if not fully
completed with the lab.
The goal of this assignment is to give you experience working with functions.
You will create a simple calculator by programming the basic functions.
- Use a text editor to complete your assignment.
- Using your text editor create a new document named "cop2500lab6.html".
Use the document here as the starting point. You may change the arrangement to your liking, but there must be a method to input 2 numbers and at least the 4 buttons to select the operation as well as a method to confirm the result.
Review Lab 6: Functions for help using functions.
|INPUT:||var x, y;
||These are obtained from from text boxes n1 and n2.|
|OTHER VARIABLES:||var result; |
|INITIALIZATION:|| n1 and n2 must be provided by the
|COMPUTATION:|| Add: result = x + y;
Subtract: result = x - y;
Multiply: result = x * y;
Divide: result = x / y;
||Remember to place the result in the form text box named answer |
Open a browser and verify that the file displays properly.