1. (60 points) A web page to collect a user's movie review contains: (1) a single form named movie_review_form; (2) a single textarea named ta containing 10 rows and 40 columns; and (3) a single button named but1 which is labelled "GO". The user will enter text (their opinion of a movie) in the textarea box and then click the "GO" button. This event will cause a sub named movie to be executed. This sub has two arrays: (1) a ten element array named words that contains the strings: "great"; "good"; "excellent"; "enjoy": "best"; "boring"; "bad"; "awful"; "waste"; and "terrible"; and (2) a ten element array named wc which should be initialized to zero. The sub should: (1) retrieve the user's text from the textarea box; (2) count the number of times each word in the words array appears in the user's text; (3) store these counts in wc; and (4) then create a page on-the-fly that prints a twelve row table with each row containing two columns: (a) Ten rows with each row containing a column with a word from the words array and a column the number of occurrences of the word in the user's text; (b) a row with with the most frequently occurring word in the first column and a column with the number of times it occurs (if there are ties, print only the last one, if there are none print "None"; and (c) the last row containing in the first column the word "TOTAL" and in the second column contains the total number of words found.
Enter Your Movie Review |
2.(40 points) A web page contains: (1) a form named lottery_form; (2) six select boxes named sel1; sel2; sel3; sel4; sel5; and sel6; (3) four checkboxes named c1; c2; c3; and c4 (all initially unchecked) and (4) an button named but2 which is labelled "CHECK MY PICKS". Each select box contains 51 options (the first option in each selectbox is "Pick A Number Below" followed by 50 options containing the digits 1 through 50). The first option is always "selected" in each select box at load time.
The user is directed to make six selections from the six select boxes and then press "CHECK MY PICKS". When the user presses the button, a sub named advise is executed. This sub should perform four tests:
If this condition is met, the program should place a check in c1
If this condition is met, the program should place a check in c2
If this condition is met, the program should place a check in c3