CMSC 104, Fall 2007
Homework 3
Your First JavaScript Program
Out:Wednesday, October 24
Due:Tuesday, October 30, before 11:59 p.m.
Note: No late projects will be accepted.
The Objective
- To learn to create and run JavaScript programs
- To become familiar with syntax error messages generated by the JavaScript error console.
The Task
- Before you begin working on the assignment, you must set up
your account so that no one else can see your Web page while you
are working on it. You will only be able to access your page
by typing in a username and password. The only people who will
be able to access your page are you, me and the graders for the
class. You *must* do this step before you begin working on your
page. Type the following command at the linux prompt:
linux2[12]% /afs/umbc.edu/users/d/b/dblock/pub/setup104
You should see something similar to the following:linux2[12]% /afs/umbc.edu/users/d/b/dblock/pub/setup104 Creating new directory: /afs/umbc.edu/users/c/m/cmsc/pub/access Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www/cs104 Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www/cs104/hw3 Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www/cs104/proj1 Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www/cs104/proj2 Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www/cs104/proj3 Using exising directory: /afs/umbc.edu/users/c/m/cmsc/pub/www/cs104/proj4 ********************************************************************* * Please enter a password other than your myUMBC/GL password below. * * This will be the password you need to access your pages online. * ********************************************************************* Creating new password file New password: Re-type new password: Adding password for user cmsc linux2[13]%
- For the first part of the assignment, you must complete the program attached to this sheet (to be distributed in class) by filling in the blanks where pieces of code are missing.
- After filling in the blanks, you are ready to move on to the second
part of the assignment. For the second part, use xemacs (
xemacs hw3.html
) to type in the JavaScript program. Type it in EXACTLY AS SHOWN, including all spacing and indentation. Some exceptions:- Insert YOUR name as the author.
- Insert YOUR username.
- Insert a heading of your choice on the page where it says "Heading for Your Page."
- You may add a <style>...</style> section to the head section of the page if you'd like to change the colors, fonts, etc.
Make sure to save the program with the filename
hw3.html
.
Sample Run
- The URL for your page will be http://userpages.umbc.edu/~username/cs104/hw3/hw3.html, where username is your GL/myUMBC username. You should refresh the page several times and run the program with different sets of values. You can assume that the user will only enter numbers as input. Here are some sample screenshots of the program:
User entering first number
User entering second number
Final results page