CS290W EXAM 2
Sample Questions


All Kinds of AWTful things going on here...

(1) Which of the following statements will make the following three Checkboxes work like HTML Radio buttons?
Checkbox frog=new Checkbox("frog",slime,true);
Checkbox slug=new Checkbox("slug",slime,false);
Checkbox iguana=new Checkbox("iguana",slime,false);
(a) CheckboxGroup = new CheckboxGroup();
(b) CheckboxGroup slime = new CheckboxGroup();
(c) Checkbox slime = new CheckboxGroup();
(d) CheckboxGroup frog, slug, iguana;

(b)

Events, (Camera), Action!

(2)
Button up = new Button ("up");
Button down = new Button ("down");
Button left = new Button ("left");
Button right = new Button ("right");
Which of the following will be true ONLY if the left button above is clicked?
(a) if (event.target == Button)
(b) if (event.target instanceof Button)
(c) if (event.target instanceof left)
(d) if (event.target == left)

(d)

Threads

(3) What phrase is necessary after "public class Whatever extends Applet" to make it possible to run Threads?
(a) contains Thread
(b) implements Threads
(c) implements Runnable
(d) allows Concurrency

(c)

Perl Variables (Scalars)

(4) Which of the following would reference one character string from an array of character strings?
(a) $asAnimorph
(b) $asAnimorph[$iWhich]
(c) @asAnimorph[$iWhich]
(d) @asAnimorph

(b)

Block Structures and Loops

(5) Which of the following is equivalent to...?
while ($fSpeed > 62.5)
(a) until ($fSpeed < 62.5)
(b) until ($fSpeed <= 62.5)
(c) while ($fSpeed <= 62.5)
(d) until ($fSpeed > 62.5)

(b)

String Manipulation

(6)
@asSearchFor = ("cows", "cattle", "bovine creatures", "moo");
$sSearchString = join ("->", @asSearchFor);
What is $sSearchString?
(a) "cows->cattle->bovine creatures->moo"
(b) "cows->cattle->bovine->creatures->moo"
(c) "cows,cattle,bovine creatures,moo"
(d) "cowscattlebovinecreaturesmoo"

(a)

Creating and Using CGI Applications

(7) CS 290W student I.Q. Lowe has the following in an html file:
<FORM ACTION = "http://icdweb.cc.purdue.edu/~loweiq/cgibin/muddle.pl" ...>
The Perl script muddle.pl does NOT use an Oracle database. But, why won't this work?
(a) muddle.pl should be muddle.cgi
(b) icdweb should be mentor
(c) cgibin should be cgi-bin
(d) ACTION should be METHOD

(a)

What is cgi-lib.pl and what does it do?

(8) Suppose that you have available the parsing program cgi-lib.pl. How do you access the value returned by the Radio button named eyeColor?
(a) $in{'Radio'}
(b) $in{'value'}
(c) $in{'FORM.eyeColor'}
(d) $in{'eyeColor'}

(d)

Perl and Oracle

(9) What does
&ora_open($hConnection, "SELECT fields FROM table WHERE criteria");
return?
(a) an array of values
(b) a handle to the login connection
(c) a handle to this query
(d) a single field from the table

(c)

Server Side Includes

(10) In the file flight.shtml, you want to have a line that tells the last time the "seats available" file was modified. Which of the following will do that?
(a) <!--#flastmod file="availseats.html" -->
(b) <!--#flastmod file="flight.shtml" -->
(c) <!--#flastmod -->
(d) <!--#flastmod "seats available" -->

(a)


Back to the exams page.
Return to homepage of CS 290W -
Advanced World-Wide Web