Click "View", then "SOURCE" to see the code
1. (40 points)
var p = new Array(21); p[0]="Brown,Annis,,1836,1897,abrown.jpg,"; |
Assume a 21 element array named p is dimensioned in
your javascript code and the array elements are assigned the string values
as shown to the left. Each string contains six data items separated by
commas. The six items are: last name, first name, middle name (if
any--i.e., there may not be any characters in this field), birth year,
death year and image file name.
Note: there is a comma at the end of each string. The button shown below at the left causes the javascript function named part1 to be executed. The program then:
|
2. (40 points) Rather than the data in the problem above being predefined as strings and stored in an array, assume the data is stored in an XML data island with id="family_data" (i.e., <XML id="family_data"> ). Assume the following DTD:
<?xml version="1.0"?>
<!DOCTYPE family [
<!ELEMENT family
( person+ ) >
<!ELEMENT person ( last_name, first_name, middle_name,
born, died, image_file_name ) >
<!ELEMENT last_name (#PCDATA)
>
<!ELEMENT first_name (#PCDATA) >
<!ELEMENT middle_name
(#PCDATA) >
<!ELEMENT born (#PCDATA) >
<!ELEMENT died
(#PCDATA) >
<!ELEMENT image_file_name (#PCDATA) >
]>
When the user clicks the VBScript sub part2 is executed. This function:
root.childNodes(i).childNodes(j).text
where
i is the index of the first level and j is the index of the second level.
Here is a sample (first three persons) of the XML data island:
<xml id="family_data"> <?xml version="1.0"?> <family> <person><last_name>Nash</last_name><first_name>Samuel</first_name><middle_name>Claude</middle_name> <born>1890</born><died>1968</died> <image_file_name>nash.gif</image_file_name></person> <person><last_name>Nash</last_name><first_name>Isaiah Parker</first_name><middle_name>Mayfield</middle_name> <born>1860</born><died>1937</died><image_file_name>ipmnash.gif</image_file_name></person> <person><last_name>Weed</last_name><first_name>Martha</first_name> <middle_name>Angeline</middle_name> <born>1861</born><died>1929</died><image_file_name>aweed.gif</image_file_name></person> . . . and 18 more persons ... then: </family></XML> |
Write only the VBScript for part2. Show NO HTML.
3. (20 points) Circle the right answer.
ANSWERS IN GRAY | ||||
1. Cullinet's main product? | ||||
(a) INGRES |
(b) INFORMIX |
(c) SYBASE |
(d) IDMS |
(e) IMS |
2. Oracle founder(s)? | ||||
(a) Plattner & Hopp |
(b) Ellison |
(c) Wang |
(d) Codd |
(e) J.D. Edwards |
3. First "Killer App" for PC's (1979) | ||||
(a) Ashton-Tate |
(b) DB2 |
(c) VisiCalc |
(d) Windows |
(e) FTP |
4. Bill Gate's first product? | ||||
(a) MS-DOS |
(b) BASIC |
(c) EXCEL |
(d) WORD |
(e) WINDOWS |
5. Autodesk founder? | ||||
(a) Mitch Kapor |
(b) Dan Bricklin |
(c) Paul Allen |
(d) John Warnock |
(e) John Walker |
6. Victim of Microsoft Excel ? | ||||
(a) Lotus Development |
(b) Ashton-Tate |
(c) Digital Research |
(d) Intel |
(e) Alpha Micro |
7. Wrote PONG? | ||||
(a) Dan Bricklin |
(b) Electronic Arts |
(c) Atari |
(d) Nolan Bushnell |
(e) Gary Kindall |
8. Microsoft' failed in its attempt in 1994 to take over...? | ||||
(a) Netscape |
(b) Novell |
(c) Computer Associates |
(d) Intuit |
(e) Oracle |
9. The developer of MS-DOS? | ||||
(a) Simon Ramo |
(b) Tim Patterson |
(c) John Page |
(d) Roy Nutt |
(e) Gordon Eubanks |
10. A windows based operating system first developed at...? | ||||
(a) Seattle Software |
(b) Santa Cruz |
(c) Bell Labs |
(d) Xerox PARC |
(e) Redmond, Washington
|