Name: _____________________________
Section: ________
FIT100 Miniquiz #4 with answers and notes
2/4/2005
Closed Book, Closed Notes
[intended to be given by clicker]
Scoring: 1 pt. per question
First study this html file. Then answer the questions.
<html>
<head>
<script language="Javascript">
function sayHello() {
document.write("Hello");
}
</script>
</head>
<body>
<br>
<script language="Javascript">
document.write("Goodbye");
</script>
</body>
</html>
1. When the browswer loads and displays this page, what will you get?
A.
HelloGoodbye
B.
GoodbyeHello
C.
Goodbye
D.
Hello
E.
Hello
Goodbye
The function sayHello is defined, but never
called.
2. When these lines of Javascript execute, what will be displayed?
var star1="Brad";
document.write(star1 + "Nicole");
A. Brad + Nicole
B. star1 + Nicole
C. star1+Nicole
D. BradNicole
E. "Brad"+"Nicole"
F. star1Nicole
The write shows the value of the
variable, not its name. The + operator causes concatenation, but
is not itself displayed.
3. Some of abbreviations below refer to steps of the fetch/execute
cycle. Which list is the complete set of steps, in the proper
order, for the fetch/execute cycle?
A. IE IF RR DF
B. CPU ALU MEM IO
C. IF ID DF IE RR
D. ID RR ALU IF
E. ADD AND DIV MULT OR SUB