. |
1. (50 points) The fastest 100 computers in the world in November 2017 are shown to the left in a textarea named ta1 in a form named f1 (see:www.Top500.org). The data for each computer is organized as follows:
- rank followed by a ";". The ranks are arranged from 1 to 100.
- website link followed by a ";"
- country followed by a ";"
- system followed by a ";"
- computer followed by a ";"
- cores followed by a ";"
- performance followed by a "$" (except for the last one)
Write the javascript function named p2 that:
- creates a string named os to store the output information
- retrieves the data from the textarea named ta1
- creates a 100 row by 7 column table using the seven data items for each computer as the column values. As the table is being created, count the number of times the country = "United States". DO NOT create a heading row.
- following the table creation, adds to the string os the HTML necessary to display on a line by itself the number of times the "United States" appeared in the country column
- places the string os in the DIV block whose id="p1_out">
this is the DIV block with id="p1_out"
Show NO HTML. Show only the javascript for p1.
|