MIDTERM EXAM PAGES 3 and 4 questions and answers - review for final exam ------------------------------------------------------------------------ 13. Finish the following program so that it does sends the web page c088.html to client browser. Assume the program is called c088colorSurprise.cgi and that it uses the function rgbValue to calculate and return two RGB triplets. The 1st is for the background color and the 2nd is for the text color. Assume that rgbValue returns an array, just like our guestBook.lib library function rgbValue does. Assume that the file c088.html has on a line all by itself, starting at the beginning of the line, the tag. Your c088colorSurprise.cgi program will send a different line to the web browser, for example: might be sent one time, and the next time, gets sent. Its all taken care of by rgbValue function, which you DO NOT have to define, you just have to use it to get the array of RGB triplets, and then use the array. #!/usr/bin/perl use CGI qw(:standard); require guestBook.lib; # <-- to have rgbValue() function open(FILE088, "../c088.html") # <-- ANSWER AAA BEGINS HERE print header; while () { chomp; if ($_ eq "") { ($bgcolor, $textcolor) = &rgbValue(); # either & or () # are required... print "\n"; } else { print "$_\n"; } } close FILE088; open(FILEBBB, "../c088.html") # <-- ANSWER BBB BEGINS HERE print "Content-type: text/html\n\n"; while () { if ( substr($_,0,6) eq "" ) # See note BBB*****OPTION { @c = &rgbValue(); print "\n"; } else { print $_; } } close FILEBBB; if ( $_ =~ m// ) <----- BBB*****OPTION see page 192 Elizabeth Castro - Turk 182 if ( $_ =~ / "calcVolume.cgi"), "\n", "Length ", qq(), p, "\n", "Width ", textfield('width'), p, "\n", "Height ", textfield('height'), p, "\n", qq(), end_form, "\n", end_html;