MIS 3371 Fall 2014 Exam 1 Parks
Top 1,000 Universities in the World
1. (50 points) The textarea (named topu) shown to the left contains data on the "Top 1,000 Universities" in a form named f1. The textarea has 1,000 universities -- each with the following data (from Center of World University Rankings) (there are 13 items per University) as described below:
1. World Rank (a number from 1 &rar; 1000) 8. Publications(# of papers 5%)
2. Institution (name/link) 9. Influence (# papers in top journals 5%)
3. Country/Region10. Citations (# highly cited papers 5%)
4. National Rank11. Broad Impact (research index 5%)
5. Quality of Education (Alumni awards 25%)12. Patents (# filed 5%)
6. Alumni Employment (CEOs 25%)13. Score (total of #5 → #12)
7. Quality of Faculty (Faculty Awards 25%)

Each of the 13 items for each university is separated by the ";" character. Each University ends with a "*" character (except the last one which has nothing at the end).
  1. retrieve the textarea data from topu
  2. split the data into 1,000 university elements using the "*" character. Name this array univ.
  3. the heading for the table is stored in predefined string named headings (a pair of row tags and 13 cell tag pairs containing column descriptions). Use headings (but DO NOT write out this string in your code) to place headings at the top of the table.
  4. then produce 1,000 rows with 13 columns each by splitting each university's data (i.e., univ[i]) into 13 values to be used in the table cells
  5. if the "Institution" data contains the string "University of Houston", make the entire row have a background color of "LightGray"
  6. after the end of the table write how many universities of in the list have "Country/Region" value of "USA".
  7. then write how many universities in the list have "Country/Region" value of "USA" in the Top 100.
When this button is clicked a javascript function named p1 is executed.
Write only the javascript for p1(). Show NO HTML.

This is the DIV block with id="p1_out"
Texas Declaration of Independence

Search phrase
2. (50 points) The texarea to the left named t2 is in a form named f2. The text inside the textarea is the Texas Declaration of Independence of March 2, 1836. Following the text is a list of each person who signed the declaration. Below the textarea is a textbox named sp where a user can enter a search phrase.

Each "sentence of the text" AND "signer of the document" ends with a "@" character (except the last one).

When the button labelled "Execute p2" is clicked, the javascript function named p2 is executed. This function:

  1. retrieves the data from t2
  2. retrieves the search phrase from sp
  3. split data from t2 using the "@" character and store in an array named sent_sign
  4. examine all elements of sent_sign. Whenever at least one occurence of sp is found in an element of sent_sign, in the DIV block with id="p2_out" display the value of sent_sign arrray element:
    1. beginning with a <br>
    2. the array element number of sent_sign + 1 (i.e., start numbering at 1), followed by a "." and a space
    3. the value of sent_sign array element
  5. At the end of the list show the number of times the sp was found. If it was NOT found show the string "NOT FOUND".
NOTE: be sure to convert BOTH sp and sent_sign to upper case before any comparisons are performed (use: string.toUpperCase() ). But, do NOT show the output in ALL upper case.

Show only the javascript for p2(). Show NO HTML.

This is the DIV block with id="p2_out"