DISC 3371 Parks Spring 2000 Final Answers 5:30 PM class

1. (60 points) Design a page that contains: (1) a table containing nine gif images laid out in three rows (three images on each row). The nine gifs are named "t0.gif" through "t8.gif". The t0.gif" is followed by t1.gif and then t2.gif on the first row, t3.gif thru t5.gif on the second row, etc.; (2) a table containing nine textboxes laid out in three rows (three text boxes per row). These nine textboxes originally contain zeros; and then (3) a single textbox named max -- also initially zero. Write a sub named swap to:

  1. When the user mouseovers any of the nine images (EXCEPT the center one -- t4.gif), the image is to be replaced by the center image and the center image is to be replaced by the image that was moused over. When the user mouses out, the two images are returned to their original state. For example, when the user mouses over t6.gif in the lower left side, the image is replaced by t4.gif and the center image t4.gif is replaced by t6.gif. When the user mouses out of the lower left side, the t6.gif is returned to the lower left side and the center gets its original t4.gif.

  2. Count each mouseover by incrementing the corresponding text box value in the second table. Note these textboxes are originally zero. For example, if a user mouses over the upper left hand image, the upper left hand textbox is to be incremented by 1.

  3. On each mouseover, use a function named getmax to return the maximum value of the counts in the nine text boxes. Then display this current maximum mouseover count in the max textbox. (i.e., for every mouseover, use getmax to find the maximum value of the nine values in the second table and display this maximum in max).

All mouseover and mouseout events call swap and swap is always passed two arguments: (1) a 0 if it is a mouseover event or a 1 if it is mouseout event; and (2) the number of the image.

Show the HTML and VBScript.

Click here for the answer page.

2. (40 points) A two frame page (two columns). The left hand frame is initially load with a page that contains ONLY a form named sform and one textarea field named story (30 rows and 40 columns). The textarea named story contains a long string of text representing a short story. The right side frame contains a form named rform with: (1) a textarea named x (also 30 rows and 40 columns) which is initially empty; and (2) a single button labelled "MAKE XML". When the user clicks the button in the right hand frame, a sub named parse is called. This sub should:

  1. retreive the story string from the left hand frame.

  2. place into the field named x, the XML markup of the text in the story string. The story textarea contains sentences that end in periods and paragraphs that end with the # character. Paragraphs have one or more sentences. The story has one or more paragraphs. All end of paragraph markers (i.e., the character #) occur in the character immediately following the period of the paragraph's last sentence. The XML should contain only the markup tags: <XML>, </XML>, <STORY>, </STORY>, <PARA>, </PARA>, <SENTENCE> and </SENTENCE>.

  3. Place the contents of the string x in the lefthand frame in the textarea named story.

  4. Submit the form in the righthand frame to "http://auckland.bauer.uh.edu/Students/parks/echoxml.exe"

Show no HTML. Show only the VBScript for parse.

Click here for the answer page.