FIT100 Miniquiz #6 2/11/2005
Closed Book, Closed Notes
Scoring: 1 pt. per question
Name: _____________________________
Section: ________

1. Assuming this Javascript code executes, what will be displayed?
<script language="Javascript">
for (var i = 0; i < 5; i++) {
     document.write("x");
}

A. x
B. xxxx
C. xxxxx
D. xxxxxx       
E. i

2. Assuming this Javascript code executes, what will be displayed?
<script language="Javascript">
for (var i = 1; i <= 3; i++) {
     document.write(i);
}

A. iii               
B. 1
C. 111
D. 333
E. 123

3. First study this html file.  Then answer the question.
<html>
<head>
</head>
<body>
<br>
<script language="Javascript">
for (var i = 1; i <= 3; i++) {
     if (i > 1) {
     document.write("x");
     } else {
     document.write("y");
    }
}
</script>
</body>
</html>

When the browswer loads and displays this page, what will you get?

A. x
B. xxx
C. xxy
D. xyy
E. yyy
F. yxx
G. yyx
H. y

4. First study this html file.  Then answer the question.
<html>
<head>
<script language="Javascript">
function looper(stop) {
     for (var i = 0; i < stop; i++) {
          document.write(stop);
    }
}
</script>
</head>
<body>
<br>
<script language="Javascript">
looper(2);
</script>
</body>
</html>

When the browswer loads and displays this page, what will you get?

A. stop
B. 012
C. 00
D. 22
E. 01