DISC 3371 MIDTERM 5:30-7 MW Spring 2000 Parks

1.(60 points) A webpage contains a form named: farm_form. This form contains a ten row table. Each row had two HTML elements: (1) a textbox with twenty characters to store the name of a farm animal; AND (2) a textbox with four characters for entering how many of these farm animals the farmer posseses (all of these textboxes are empty at load time). Following the table is a button named farmbutton which is labelled "GO". The user is directed to enter the name and number of each farm animal in the spaces provided in the table (up to ten different animals). When the user presses the "GO" button, a sub named farmcount is executed. The farmcount sub should:

  1. copy the animal names to an array named fn.
  2. copy the number of each animal to an array named fc
  3. then create a page on-the-fly with a thirteen-row two-column table that shows:
    1. A row with each animal name (first column) and how many (second column)
    2. The name (column 1) and number of the farm animal with the largest count (column 2) (if tied, show only the last one)
    3. The name (column 1) and number of the farm animal with the smallest count (column 2) (if tied, show only the last one)
    4. The total number of farm animals (the word "TOTAL" in column 1 and the count in column 2)

Validate the user's number-of-animal entries in the second column before using them in computations or comparisions.

Show NO HTML. Show ONLY the VBScript.

 
 
 
 
 
 
 
 
 
 

2. (40 points) A web-based instructor evaluation form (the form is named cform) contains eight textareas (numbered 1 thru 8 and contain 2 rows and 40 columns each) and a single button named gobutton and labelled "GO". The user is directed to enter an evaluation of each of their courses in a textarea -- up to 8 different courses can be evaluated on the form. For each course, the user is directed to provide two things in each textarea:

  1. any text comments that they wish to make; and
  2. an overall evaluation of the course by entering one of the following words somewhere in the textarea: "EXCELLENT"; "GOOD"; "AVERAGE"; "FAIR"; or "POOR"

After the user enters their evaluations and presses the "GO" button, a sub named checkme is called. This sub should check each non-empty textarea (i.e., the user has entered at least one character in the textarea) for the existence of a course evaluation word ("EXCELLENT"; "GOOD"; "AVERAGE"; "FAIR"; or "POOR")

If a textarea is missing an evaluation WORD, display the message "NO evaluation word in evaluation X" (where X is the number of the textarea 1 thru 8).

1.
2.
3.
4.
5.
6.
7.
8.