2012 TOP 100 PLACES TO LIVE IN THE US
from CNN Money |
1. (50 points) The textarea (named t100) shows CNN Money magazine's Top 100 places to live in the US for 2012. The textarea is in a form named f1.
The format of the data in the textarea is:
• ranking followed by a semicolon; • name of the town followed by a semicolon; • two character state abbrviation followed by a semicolon; • city population followed by an asterisk (*); So, each town has 4 fields: ranking, name, state and population. Further, there are two arrays available in your code: (1) a 50 element array named s which contains the 50 state abbreviations: s = Array ("AK","AL","AR","AS", ... ,"VT","WA","WI","WV","WY"); and (2) a 50 element array named sc which contains 50 zeroes: sc = Array (0,0,0,0,0,0, ... ,0,0,0,0,0) Produce a report by with the following two items:
The button labelled "Execute p1" (to the left) causes a vbscript sub named p1 to be executed. Show NO HTML. Show ONLY the vbscript code for the sub named p1.
|
|
2. (50 points) The textarea named ta3 is in a form named f2. The textarea contains list of the signers of the Declaration of Independence arranged by state. The states are separated by the an asterisk (*). A comma follows each state name. Following this comma are: the signer's name, a comma, their portrait image name, and another comma. The last image name in the state is NOT followed by a comma.
There is a button labelled "Execute p2" that causes the javascript function p2 to be executed. Write this javascript function that:
• 1. retrieves the contents of the textarea named ta3
<img src='http://www.ushistory.org/declaration/signers/images/signer image name' width='60'> • then place the signer's name underneath the image.
Hint: row 1 and row 2 are different tasks. You have to pass through the data twice. Use separate code segments for each row. Portrait images are found at: http://www.ushistory.org/ (by Ole Erekson, Engraver, c1876, Library of Congress) |