Revised: September 11, 2001

Assignment 1

Create a home page that will contain links to the work you do in this class.  Create a link from this page to another page.  This second page will contain a JavaScript calculator program.  Display the calculator using form buttons.  Recall that you can create a form button as follows:

<form>
<input type="button" value="Calculate">
</form>

This will display a button with the word "Calculate" on it.

Your calculator should have buttons for each of the digits 0 to 9, buttons for addition, subtraction, multiplication and division, and a calculate or equals button.  You are welcome to add additional buttons, such as buttons for parentheses.  It need only operate on two numbers at a time although it "should be easy" to have it deal with more than 2 numbers.  Display the result of the calculation on another button.

You will need to give the form and each button a name so you can refer to them in JavaScript code as document.formName.buttonName  You can refer to the value of this button as document.formName.buttonName.value

Although you are not required to use functions to complete this assignment, consider using them if they are appropriate.  Use JavaScript comments to explain what you are doing if it isn't obvious.

When you are done, FTP your home page and the your calculator page to your website.  You need not email me when it is done.