DISC 3371 Parks Spring 2000 Final Answers 4PM class

1. (60 points) Given:

Birthday Data
 First Name
 Last Name
 YY
 MM
 DD








































XML String

The left frame above contains two forms. The first form contains fields for a user to enter eight friends' names and birthdays. The second form contains a single hidden variable named xs. This frame also contains a button labelled "Send the XML". The right side frame contains a single textarea named showxml. The user will: (1) enter data into ALL fields in the left frame; (2) the user will then click the "Send the XML" button. This event will cause a sub named alice to be executed. This sub will: (1) Sort the eight friends' birthday data into ascending "First Name" order; (2) construct an XML representation of the content of the left frame and store it in the string named xs; (3) display the resulting xs string in the textarea (named showxml) in the right side frame; and (4) send the resulting second form (the one containing only the string xs) to "http://auckland.bauer.uh.edu/Students/parks/echoxml.exe".

The data in the left frame is organized into a four row table. The first row contains only the text "BIRTHDAY DATA". The second row contains the column headings. The third row contains the data fields. Each column of data (eight fields) is stored in a single cell in the third row. The fourth row contains the button.

The choice of XML tags is up to you. Assume all fields will be filled in by the user. Do not write editing code to check for blank fields. Use NO arrays in alice. Show NO HTML. Show only the VBScript for alice.

Click here for the answer.

2. (40 points) Design a two frame page (two columns). The left side frame contains: (1) the text "My Expenses"; (2) six text boxes of size="6"; and (3) a button labelled "GO". The six textboxes should be labelled: (1) Housing; (2) Food; (3) Auto; (4) School; (5) Fun; and (6) Taxes. The right side frame is initially a blank html page. When the user clicks the "GO" button, a sub named harvey is executed. This sub:

  1. sums the six expense values and calculates the percentage (not proportion) of the total for each of the six expenses. These percentages are to be stored in an array named pc.
  2. In the right side frame, a horizontal bar graph is to be constructed on-the-fly using six different gif images laid out side-by-side.
  3. A function named get_gif_name is to be used to return the name of the gif file as the horizontal bar is being created on-the-fly. The function is passed a single integer arguement that represents the number of the gif file to be named (i.e., an integer from 1 to 6). The function returns a six byte string which the the full name of the file. The six gif files are named: (1) g1.gif; (2) g2.gif; (3) g3.gif; (4) g4.gif; (5) g5.gif; and (6) g6.gif;

The resulting bar graph (i.e., the six side-by-side gifs) is to be a total of 100 pixels wide and 30 pixels tall. The width of each of the six gif files represents the six percentages calculated in the previous step and stored in pc. (e.g., if the "Food" expense entered by the user is 66% of the total, then the width of the second gif is 66 pixels). The six gifs names and colors are: g1.gif (red), g2.gif (white), g3.gif (blue) ,g4.gif (yellow), g5.gif (green), and g6.gif (black). Each is one pixel by one pixel in size.

Restating for clarity: When completed, the right side frame will contain six gif images (g1.gif through g6.gif) placed side-by-side. The width of each gif corresponds to the percentages in pc. The visual image is a horizontal bar composed of six colored rectangles (red, white, blue, yellow, green, and black). The horizontal bar will be a total of 100 pixels wide and 30 pixels tall.

Show the HTML for the entire frameset and the two individual frames. Show the VBScript for harvey.

Click here for the answer.