COP3832, Fall 2000, Assignment 2
Due Monday 10/2 at the start of class.
To hand in the assignment, do the following
-
Hand in a printout of the source code for the hw2.html file.
-
Also, send me an e-mail message with the URL of your home page when the
assignment is ready to be graded.
-
Upload a copy of the hw2.html file using the
~downeyt/cshome/public/webftp/webftp.pl program from mongoose.
It is imperative that you do not allow anyone else to have access to the
hw2.html file.
Set up a web site on mongoose.aul.fiu.edu
Create an HTML page on mongoose named hw2.html that is generated
dynamically using JavaScript. The page should do the following:
-
Be sure that all of your <SCRIPT> tags are in the body. Do not
include any JavaScript in the <HEAD> section of the html
file.
-
You may use global variables. Use functions to organize your code. You must
have at least three functions: read the data; display the table; display
the average, min, and max.
-
Read an unspecified amount of numbers from the user. Continue reading numbers
from the user until a negative number is entered.
-
Display all the numbers entered in a table. Do not include the terminating
negative number. The table should be square, that is it should have the same
number of rows as columns. Use the smallest square table possible to hold
all the numbers entered. It is possible that the last row of the table will
have some (or all) empty cells.
-
Display the count and total of all the numbers.
-
Display the count and average of all the numbers, rounded to two decimal
places.
-
Display the largest number and its location in the list of numbers that were
entered.
-
Display the smallest number and its location in the list of numbers that
were entered.
Some useful functions from JavaScript
-
document.write(string)
-
document.writeln(string)
-
document.close( )
-
Math.round(number)
-
Math.ceil(number)
-
Math.floor(number)
-
Math.sqrt(number)