Last Name, First Name _____________________________________________________ Last 4 digits of PSID _____________
This is the DIV with id='p1_out'
|
1. (50 point) The textarea shown to the left contains data on the 440 U.S. House of Representatives members. The DTD for the data is shown below.
<?xml version="1.0"?> <!DOCTYPE house_reps [ <!ELEMENT house_reps(rep+)> <!ELEMENT rep (fullname,web,state_dist,party,office,tel,com+)> <!ELEMENT fullname (#PCDATA)> [lastname , firstname and optional initial] <!ELEMENT web (#PCDATA)> [web address] <!ELEMENT state_dist (#PCDATA)> [state and district] <!ELEMENT party (#PCDATA)> ["R" = republican, "D" = democrat] <!ELEMENT office (#PCDATA)> [office building and room number] <!ELEMENT tel (#PCDATA)> [telephone number] <!ELEMENT com (#PCDATA)>]> [committee name(s)]When the "Execute p1" button is clicked, roll the data into a 440 row by 7 column table. Columns 1 through 6 contain: fullname through tel. Column 7 contains one or more committee names (com values) in a <ul> list.
Begin your code assuming root has already been defined in your code. Place the resulting table in the DIV with id="p1_out" and after the end of the table show the count of republican AND democratic representatives. Provide NO table heading row. Show only the javascript for p1. |
2. (50 points) Create a display of a 58 key keyboard layout. The layout is
made with 58 DIV blocks that each begin like this: <div style="border:solid black 1px;font-size:13px;position:absolute;text-align:center;background-color:gray;color:white;width:22px;height:22px;...
For each if the 58 keys: 1) add the CSS for top and left to the DIV shown above 2) place the key's text inside the DIV Place the resulting 58 key DIVs into the DIV with id="p2_out". Show no HTML. Show only the javascript for p2. |
Assume the following are defined in p2 (DO NOT WRITE these on your exam):
1. keys = "F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12, ... ,Z,X,C,V,B,N,M,<,>,?"; [keys is a string with the 58 key values separated by commas] 2. keys_per_row = [12,13,12,11,10]; [use this for the interior loop counts] 3. left_start = [13,0,13,26,39]; [this defines the initial left for each row] 4. top_val = [0,26,52,78,104]; [this defines top for the row]
this is div with id="p2_out"
|