wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Computer Programming I Finals

Total questions: 11

Worksheet time: 4mins

Name
Class
Date
1.

A for loop is a post-test loop.

a)

True

b)

False

2.

A syntax error will result if the control statements of a for loop are omitted.

a)

True

b)

False

3.

If a semicolon is placed at the end of a for loop, an infinite loop will result.

a)

True

b)

False

4.

If the initial condition of any while loop is false it will still execute once.

a)

True

b)

False

5.

In a for loop, which of the following is executed first?

a)

initial expression

b)

logical expression

c)

update expression

d)

for loop statement

6.

In do-while statement, the condition is evaluated first before the block statement is executed.

a)

True

b)

False

7.

The for loop has three (3) expressions, for( expr1; expr2; expr3 ). All the three expressions are required.

a)

True

b)

False

8.

The following is a valid declaration of an array in Java:
int x[][] = new int[][3];

a)

True

b)

False

9.

The last index of one dimensional array is equal to the length of the array -1.

a)

True

b)

False

10.

Which executes first in a do...while loop?

a)

statement

b)

logical expression

c)

initial statement

d)

update expression

11.

a)

True

b)

False