wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Unit 6: Repetition Test Review

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Determine how many times the loop will execute.

count = 20

Do While count > 10

...

count = count - 2

Loop

a)

5

b)

10

c)

6

d)

11

2.

Determine how many times the loop will execute.

counter = 0

Do While counter < 5

...

counter = counter + 1

Loop

a)

4

b)

5

c)

6

d)

7

3.

Determine how many times the loop will execute.

var = 0

Do

...

var = var + 3

Loop Until var > 9

a)

2

b)

3

c)

4

d)

5

4.

Determine how many times the loop will execute.

var = 0

Do

...

var = var + 10

Loop Until var > 2

a)

0

b)

1

c)

2

d)

3

5.

Determine how many times the loop will execute.

var = 0

Do While var > 2

...

var = var + 5

Loop

a)

0

b)

1

c)

2

d)

3

6.

Determine how many times the loop will execute.

For i = 3 To 6

...

Next

a)

3

b)

4

c)

5

d)

6

7.

Determine how many times the loop will execute.

For i = 10 To 20 Step 2

...

Next

a)

7

b)

4

c)

5

d)

6

8.

Determine how many times the loop will execute.

For i = 2001 To 2010

...

Next

a)

8

b)

9

c)

10

d)

11

9.

Trace the program and determine the output.

yr = 0

Do While yr < 4

lstOutput.AddItem(yr)

yr = yr + 1

Loop

a)

0

1

2

3

b)

0

1

2

3

4

c)

0

1

2

d)

1

2

3

10.

Trace the program and determine the output.

var = 0

Do While var < 4

lstOutput.AddItem("Einstein")

var = var + 2

Loop

a)

Einstein

Einstein

b)

Einstein

c)

Einstein

Einstein

Einstein

d)

Einstein

Einstein

Einstein

Einstein

11.

Trace the program and determine the output.

var = 0

Do

lstOutput.AddItem("Newton")

var = var + 3

Loop Until counter > 9

a)

Newton

b)

Newton

Newton

c)

Newton

Newton

Newton

d)

Newton

Newton

Newton

Newton

12.

Trace the program and determine the output.

For k = 1 To 5

lstOutput.AddItem("VB97")

Next

a)

VB97

VB97

b)

VB97

VB97

VB97

VB97

VB97

c)

VB97

VB97

VB97

VB97

d)

VB97

VB97

VB97

VB97

VB97

VB97

13.

What is the definition of a counter variable?

a)

variable that counts up as a loop repeats

b)

value that determines whether a loop executes

c)

variable that adds up values as a loop repeats

14.

What is the definition of an accumulator variable?

a)

variable that counts up as a loop repeats

b)

value that determines whether a loop executes

c)

variable that adds up values as a loop repeats

15.

What is the definition of an sentinel value?

a)

variable that counts up as a loop repeats

b)

value that determines whether a loop executes

c)

variable that adds up values as a loop repeats

16.

Determine whether the loop will be infinite.

For i = 1 To 6

lstOutput("Repetition")

Next

a)

infinite

b)

not infinite

17.

Determine whether the loop will be infinite.

test = 0

Do While test < 3

test = test + 1

Loop

a)

infinite

b)

not infinite

18.

Determine whether the loop will be infinite.

test = 0

Do While test < 3

test = test - 1

Loop

a)

infinite

b)

not infinite

19.

Determine whether the loop will be infinite.

test = 8

Do

test = test - 1

Loop Until test < 3

a)

infinite

b)

not infinite

20.

Determine whether the loop will be infinite.

test = 4

Do

test = test +1

Loop Until test < 3

a)

infinite

b)

not infinite