wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PDM - LS01 - Quiz 3 - Repetition

Total questions: 15

Worksheet time: 6mins

Name
Class
Date
1.

Below are the goal of repetition structure, except....

a)

avoid duplicate code

b)

allow set of statements to execute repeatedly

c)

cut the time consuming

d)

make the program larger

2.

Below are the condition controlled loops except...

a)

Do - Until Loop

b)

For Loop

c)

While Loop

d)

Do - While Loop

3.

Which one is the called pre-test loop?

a)

Do - Until Loop

b)

For Loop

c)

While Loop

d)

Do - While Loop

4.

Which one is the called post-test loop?

a)

Do - Until Loop

b)

For Loop

c)

While Loop

d)

Do - While Loop

5.

Why Do - Until Loop & Do - While Loop is called post test loop?

a)

Because they are counted loop

b)

Because they needed to be in TRUE condition first

c)

Because they are iterate at least one time

d)

Because they needed to be in FALSE condition first

6.

Which one is the count controlled loop?

a)

Do - Until Loop

b)

For Loop

c)

While Loop

d)

Do - While Loop

7.

Sentinel is a special value that marks the end of a list of values, used as stop values for loops by ask the user how many times the loop should process in the beginning

a)

TRUE

b)

FALSE

8.

When will this pseudocode stop?

a)

until i == 1

b)

until sum == 1

c)

until N == input

d)

until N == sum

9.

Which one is called the increment in this pseudocode?

a)

FOR i = 1 to N

b)

Step 1

c)

sum = sum + i

d)

INPUT N

10.

If N = 5, then what is the result of sum?

a)

15

b)

10

c)

5

d)

1

11.

What is the sentinel in this pseudocode?

a)

total mark = 0

b)

mark = 1

c)

mark != -1

d)

total mark = mark + mark

12.

What this pseudocode goal?

a)

calcute the total of input marks entered by user until the user input 0 as mark

b)

calcute the total of input marks entered by user until the user input all the mark

c)

calcute the total of input marks entered by user until the user input 1 as mark

d)

calcute the total of input marks entered by user until the user input -1 as mark

13.

When will this pseudocode stop?

a)

when user input the temperature != -999

b)

when user input the temperature == -999

c)

when user input the temperature > max

d)

when user input the temperature < max

14.

What will happen if the input temperature is 30? What happened next?

a)

max = 30

b)

total = 30

c)

n = 1

d)

average = 30

15.

What is the output if the user input -1 then followed by -999? What will happened?

a)

program error

b)

print average = 0

print max = 0

c)

print average = -1

print max = 0