]> Otis Cribble 41 20 20 ASP.NET 11 Oracle 13 C 20 Kane Jeeves 23 2 2 ASP.NET 1 HTML 3 Darth Cobble 61 40 15 ASP.NET 10 Oracle 16 C 25 Java 8 COBOL 15 Fortran 38 William Wallace 28 6 4 PHP 6 MySQL 6 William Bruce 33 9 4 Sybase 5 MySQL 4
 
DISC 3371 PARKS FINAL SPRING 2009
 
Show Presidents containing:
1. (50 points) Two arrays are provided in a vbscript sub named p1. The first is named pn and contains 44 elements (the first is 1) that are the names of the US presidents (e.g., pn[1]="George Washintgton"); the second array is named im and also has 44 elements (first is 1) and contains the image names for each president (e.g., im[1]="president1.jpeg" contain's George Washington's picture). The textbox above is in a form named f1 and is named sv. This textbox tag contains: onKeyUp="p1()". The sub p1 is thus executed every time a user types a character in sv and releases the key. p1 then searches ALL 44 elements of the array named pn looking for all president's names that contain the string in the textbox sv (BOTH values should be converted to uppercase before searching). The sub creates a borderless table that contains one cell for each "matching president". This cell contains: (1) the president's number (1 thru 44); (2) the president's image (im[i]); (3) a <br> tag; and (4) the president's name (pn[i]) (Note: 1 <= i <= 44). This table may have anywhere from zero to 44 cells in its ONLY row, depending on what the user typed. When the searches are done, the resulting table is placed in the span block with id="po" (as shown above for the search of "James"). If no matches are found, display "No Matches" in "po". Show NO HTML. Show ONLY the javascript for p1.
<XML id="tech_inv_data">
<?xml version="1.0"?>
<!DOCTYPE tech_inv [
<!ELEMENT tech_inv (person+)>
<!ELEMENT person (first,last,age,yr_exp,yr_com,skill+)>
<!ELEMENT first (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT age (#PCDATA)>
<!ELEMENT yr_exp (#PCDATA)>
<!ELEMENT yr_com (#PCDATA)>
<!ELEMENT skill (desc,yr_skill)>
<!ELEMENT desc (#PCDATA)>
<!ELEMENT yr_skill (#PCDATA)>
]>
<tech_inv>
<person>
<first>Otis</first><last>Cribble</last>
<age>41</age>
<yr_exp>20</yr_exp>
<yr_com>20</yr_com>
<skill><desc>ASP.NET</desc>
<yr_skill>11</yr_skill></skill>
<skill><desc>Oracle</desc>
<yr_skill>13</yr_skill></skill>
<skill><desc>C</desc>
<yr_skill>20</yr_skill></skill>
</person><person>
<first>Kane</first><last>Jeeves</last>
<age>23</age>
<yr_exp>2</yr_exp>
<yr_com>2</yr_com>
<skill><desc>ASP.NET</desc>
<yr_skill>1</yr_skill></skill>
<skill><desc>HTML</desc>
<yr_skill>3</yr_skill></skill>
</person>
...lotsa line omitted ...
</tech_inv>
</XML>
2. (50 points) For every person in a firm's MIS department, a "technology skills inventory" is maintained. This data is kept in an XML file and is embedded in an HTML page in a data island with id="tech_inv_data". (the DTD and a portion of the XML data are shown to the left). When this button is clicked, a javascript function named p2 is called. This function produces a new page on-the-fly which is a table showing my entire technology capability inventory by person. This two-column table has:
  • A heading row ("TECHNOLOGY SKILLS INVENTORY") in bold with a gray background.
  • For each person:
    • A row with "Person: " followed by the person's first and last names in bold.
    • A row with the person's: (1) age; (2) years of experience; and (3) years with the company in bold.
    • A row for each skill of the person with the skill "description" in the first column and the years of the skill experience in the second.
  • Following the table are three averages in bold:
    1. a row with "Average Age"
    2. a row with "Average Years Experience"
    3. a row with "Average Years with the Company"
The number of persons is root.childNodes.length;
The first name is root.childNodes(i).childNodes(0).text;
The last name is root.childNodes(i).childNodes(1).text;
The age is root.childNodes(i).childNodes(2).text;
The years of experience is root.childNodes(i).childNodes(3).text;
The years with the company is root.childNodes(i).childNodes(4).text;

Skills are numbered 5 through root.childNodes(i).childNodes.length;
where i is the person.
The skill description is:
    root.childNodes(i).childNodes(j).childNodes(0).text;
The number of years experience for each skill is:
    root.childNodes(i).childNodes(j).childNodes(1).text;
where i is the person and j is the skill.

Show the javascript for p2. Show NO HTML. Show NO XML.