wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Problem Solving PP2

Total questions: 24

Worksheet time: 12mins

Name
Class
Date
1.

What is printed by the pseudocode if the input values are 5 and 2 respectively?

a)

6

b)

12

c)

14

d)

24

2.

A complier is software that converts the

a)

source code to assembly code

b)

source code to machine code

c)

program to output

d)

program to object code one instruction at a time

3.

The result of the expression 3 MOD 4 is

a)

0

b)

1

c)

3

d)

4

4.

The variable total is assigned the value 12. Which output shows the CORRECT display when the code Write "total =", is executed

a)

total =

b)

12

c)

total = 12

d)

"total ="

5.

Which of the following identifiers is a valid variable name?

a)

Begin

b)

iCount

c)

Num-1

d)

5Sum

6.

Which of the following structures is most commonly used to implement a post-test

loop?

a)

for -do

b)

while-do

c)

if-then

d)

repeat- until

7.

Which of the following is NOT a third- generation language?

a)

Assembly

b)

COBOL

c)

C

d)

PASCAL

8.

Which of the following e true about the use of indentation in Programming?

I: To make the layout of the code attractive.

II: For compiler/interpreter to identify errors easily

III: For easy understanding of the order of code

IV: For easy correction of syntax errors

a)

I, II and III only

b)

I, III and IV only

c)

II, III and IV only

d)

I, II, III and IV only

9.

The purpose of comments in program code is to

I. allow persons who read it to follow the processes

ll. know the purpose of the program

III. generate code

a)

I, ll and lll

b)

ll and III only

c)

| and III only

d)

I and II only

10.

The following is a fragment of code.

For Discount=10 to 12 do

Write ('&&')

What is the output of the above fragment of code?

a)

&&

b)

&&&

c)

&&&&&&

d)

Nothing will be printed

11.

The following is a fragment of code.

Count = 3

Discount = 0

While (Discount < Count) Do

Write('*');

Count := Count - 1

What is the output of this fragment of code?

a)

**

b)

***

c)

****

d)

There will be no output, because the code has an error.

12.

Assigning 3.14 to pi( π\pi ) means that pi should be declared as

a)

integer

b)

real

c)

string

d)

char

13.

Which of the following statements includes loops

a)

Sequencing

b)

Repetition

c)

Selection

d)

Ordering

14.

The missing entry in the truth table below is

a)

1

b)

T

c)

F

d)

0

15.

The steps involved in problem-solving include

I. developing an algorithm

II. defining the problem

III. testing the solution

What is the correct order. of the steps listed above?

a)

I, II, III

b)

II,I, III

c)

II, III, I

d)

III, I, II

16.

Step 2 in the above algorithm is an example of

a)

input

b)

processing

c)

output

d)

storage

17.

Which of the steps in the above algorithm are examples of processing?

a)

2 and 3

b)

3 and 4

c)

3 and 5

d)

4 and 5

18.

The integer variables a, b and c, are given the values 6, l0 and 2 respectively.

What is the result of the expression

a MULT (b DIV c)

a)

0

b)

20

c)

30

d)

120

19.

The original code written by the programmer is termed

a)

object code

b)

source code

c)

machine code

d)

symbolic code

20.

What is the value of X?

a)

3

b)

8

c)

9

d)

14

21.

Which of the following series of numbers represents the correct output when the number 3 is input?

a)

2,1,0

b)

2,1,0,-1

c)

2,1,0,-2

d)

3, 2,1,0,-1

22.

The structure below represents

a)

sequencing

b)

repetition

c)

selection

d)

ordering

23.

How many times will the loop be executed by following statement?

FOR mark: = -1 to 5 DO

Write (‘^’);

a)

-1

b)

0

c)

5

d)

7

24.

What is the output of the following algorithm?

A=5

B=4

REPEAT

PRINT A

A = A – 1

UNTIL A < 4

a)

3,2

b)

4,3

c)

4,5

d)

5,4