MIS 3371 Fall 2013 Final Exam Parks
Enter 3 byte text
White Gray
1. (50 points). The famous 1972 IBM "8-bar" logo is shown to the left. The IBM logo text letters are shown using the font named "Men in Blue" from the foundry: http://www.digitalempires.com. Also shown is a three byte logo (i.e., "WWW") created to simulate an "IBM-logo-like" font. The lower logo is created by the javascript function named p1 when the button labelled "Execute p1" is clicked. This sub:
  1. Retrieves the 3 bytes from the textbox (below left, named t1 in a form named f1)
  2. Creates a string named os containing: (a) the three bytes in t1; and (b) eight DIV blocks that create solid bars (white or gray) that overlay the three big bytes.
    Each DIV contains NO data. They ALL have the style properties:
    position:absolute;left:0px;width:265px;height:4px;font-size:2px;margin:0px;z-index:10px;
  3. Further, each DIV also has a "top" attribute. The first bar has "top:34px;", the second "top:42px;", the third "top:50px;"... etc. (i.e., each bar's top attribute increases by 8)
  4. Further, use the color specified by the radio button "checked" as the background-color style of each of the 8 DIV blocks
  5. The string os is to placed in the DIV with id="tout" that has style="z-index:2;font-family:Arial Black;color:black;font-size:85px;background-color:white;" [NOTE: This DIV is already on the page -- do NOT create this in your code or change its attributes]
Write the javascript for p1. Show NO HTML.
<XML id="tex_gov_list">
<?xml version="1.0"?>
<!DOCTYPE tex_govs [
<!ELEMENT tex_govs (gov+)>
<!ELEMENT gov (govnum, govname, term_start, term_end, party, lt_gov+)>
<!ELEMENT govnum (#PCDATA)>
<!ELEMENT govname (#PCDATA)>
<!ELEMENT term_start (#PCDATA)>
<!ELEMENT term_end (#PCDATA)>
<!ELEMENT party (#PCDATA)>
<!ELEMENT lt_gov (#PCDATA)>
]>
<tex_govs><gov><govnum>1</govnum><govname>James Pinckney Hterm_enderson</govname> <term_start>February 19, 1846</term_start><term_end>December 21, 1847</term_end><party>Democratic</party> <lt_gov>Albert Clinton Horton</lt_gov></gov> <gov><govnum>2</govnum><govname>George T. Wood</govname> <term_start>December 21, 1847</term_start><term_end>December 21, 1849</term_end><party>Democratic</party> <lt_gov>John Alexander Greer</lt_gov></gov> <gov><govnum>3</govnum><govname>Peter Hansborough Bell</govname> <term_start>December 21, 1849</term_start><term_end>November 23, 1853</term_end><party>Democratic</party> <lt_gov>John Alexander Greer (1849-51)</lt_gov><lt_gov> James W. Hterm_enderson (1851-53)</lt_gov></gov><xml id="census_2009">
...lotsa lines omitted...
<gov><govnum>45</govnum><govname>Ann Richards</govname> <term_start>January 15, 1991</term_start><term_end>January 17, 1995</term_end><party>Democratic Bob Bullock</party><lt_gov>William P. Hobby, Jr.</lt_gov></gov> <gov><govnum>46</govnum><govname>George W. Bush</govname> <term_start>January 17, 1995</term_start><term_end>December 21, 2000</term_end><party>Republican</party> <lt_gov>Bob Bullock (1995-99)</lt_gov><lt_gov> Rick Perry (1999-2000)</lt_gov></gov> <gov><govnum>47</govnum><govname>Rick Perry</govname> <term_start>December 21, 2000</term_start><term_end>Incumbent</term_end><party>Republican</party> <lt_gov>Bill Ratliff (acting) (2000-03)</lt_gov><lt_gov>David Dewhurst (2003-present)</lt_gov></gov> </tex_govs></XML>
2. (50 points) The XML shown to the left contains data about the 47 govenors of Texas. The XML is in an IE XML container with id="tex_gov_list". Write a javascript function named p2, that is executed by clicking this button:   This function processes the XML to produces a: a 47 row, 6 column table that contains in each row:
(1) the govenors sequence num (govnum) in the 1st column;
(2) the govenors name (govname) in the 2nd column;
(3) the beginning date (term_start) of their office in the 3rd column;
(4) the term_ending date (term_end) of their office in the 4th column;
(5) the political party (party) in the fifth column;
(6) one or more lieutenant govenors (lt_gov) -- each on a line by itself in the 6th column

Further, after the table, display the number of people with the name "Hobby" (govenor OR lt. govenor)

Notes:
root.childNodes.length is the number of the govenors (1→47)
for (i=0;i<root.childNodes.length;i++) is the loop for the govenors
root.childNodes(i).childNodes(0).text is the govenor number
root.childNodes(i).childNodes(1).text is the govenor name
root.childNodes(i).childNodes(2).text is the beginning office date
root.childNodes(i).childNodes(3).text is the term_ending office date
root.childNodes(i).childNodes(4).text is the political party
for (j=5;j<root.childNodes(i).childNodes.length;j++) is the loop for the lt. govenor(s)
root.childNodes(i).childNodes(j).text is the lieutenant govenor's data (names and dates)

Show only the javascript for p2. Show NO HTML.

this is the pout3 DIV block

this is the pout2 DIV block