wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Problem Solving, Algorithm Development and Program Design

Total questions: 40

Worksheet time: 24mins

Name
Class
Date
1.

Which algorithm correctly calculates the average and sum of two user inputted numbers and displays the result of both?

a)

read a

read b

c=a+b

d=a+b/2

print c, d

b)

read a

read b

c=a+b

d=c/2

print c, d

c)

read a

c=a+b

d=(a+b)/2

print c, d

d)

read a

read b

d=c/2

c=a+b

print c, d

2.

Which construct should be used to count from 1 to 5 and print each number consecutively?

a)

IF-THEN-ELSE

b)

FOR-DO-ENDFOR

c)

WHILE-ENDWHILE

d)

IF-THEN-ELSE-IF

3.

Which pseudocode prints out the two times table for the numbers 1 to 6?

a)

For number = 1 to 6 do

product =number *2

print number

Endfor

b)

Display "Number", "Product"

While number <= 6 do

product =number *2

print number, product

Endwhile

c)

Display "Number", "Product"

For number = 1 to 6 do

product =number *2

print number, product

Endfor

d)

Display "Number", "Product"

While number = 1 to 6 do

product =number *2

print number, product

Endwhile

4.

Which of these is an example of a language a computer would understand?

a)

Binary

b)

Pascal

c)

C

d)

All the above

5.
Before a computer can understand a program it must be...
a)
Translated into its machine code.
b)
Translated into a high level language.
c)
Translated into a low level language.
d)
Converted into binary.
6.

Which of these is an example of a debugging technique

a)

Documentation

b)

Execution

c)

Error Checking

d)

Dry run

7.

Which of the following is not a high level programming language?

a)

Assembly

b)

C

c)

Java

d)

Pascal

8.
Which of the following is the definition of a variable?
a)
A container which is used to store values such as the number of attempts a person tries to log on to a network.
b)
A language that is similar to a real programming language, but is easier for humans to understand although it doesn’t actually run on a computer. It can easily be converted to a regular programming language.
c)
A value that cannot be altered by the program during normal execution: the value stays the same. 
d)
Messages to explain to others, and often to remind yourself, what the code is intended to do. 
9.

What command would you use to create prompting instructions in Pascal?

a)

print

b)

read

c)

char

d)

integer

10.

A user enters the letter A during the execution of a program. How would you describe that data?

a)

Character constant

b)

String constant

c)

Integer variable

d)

Character variable

11.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
Which part is the identifier?
a)
10
b)
=
c)
distanceToSchool
12.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
What is the value of the variable?
a)
10
b)
=
c)
distanceToSchool
13.
Which of the following assignment statements is assigning a number .
a)
myAge = 21
b)
myAge = "21"
14.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
15.
When writing pseudocode it is a good idea to add comments to explain to others, and often to remind yourself, what the code is intended to do. 
To separate these comments from the actual code, what character(s) are used?
a)
:
b)
//
c)
()
d)
#
16.

You have declared the variable totalheight in a program. It stores the total height of several students, measured in centimeters. What type of data is this most likely to be?

a)

integer

b)

real

c)

character

d)

string

17.

What are the two main ways that algorithms can be designed?

a)

Images or text

b)

In pseudocode or as a flowchart

c)

By hardware or software

18.

What is pseudocode?

a)

A way of describing a set of instructions in text form

b)

A specific programming language that all computers use

c)

A diagrammatic representation of a set of instructions

19.

What is the symbol for a decision in a flowchart?

a)

A parallelogram

b)

A diamond

c)

A circle

20.

Which of these is the correct symbol for a process in a flowchart?

a)

A diamond

b)

A rectangle

c)

A parallelogram

21.

How are symbols connected together in a flowchart?

a)

Symbols do not get connected together in a flowchart

b)

With lines and an arrow to show the direction of flow

c)

By numbers

22.

What is important to remember when designing an algorithm?

a)

whether to use a flowchart or pseudocode

b)

the instructions are in the correct order

c)

that it must be easy to read

23.

An integer is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

24.

A real is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

25.

Pick the correct line which creates a variable called 'name' which is a string.

a)

name as string

b)

string = name

c)

name = string

d)

string as name

26.

The best data type for a name is...

a)

integer

b)

real

c)

string

d)

boolean

27.

The best data type for an average is...

a)

integer

b)

real

c)

string

d)

boolean

28.

The best data type for a counter is...

a)

integer

b)

real

c)

string

d)

boolean

29.

What are the two main categories of loop?

a)

Count & Sentinel Controlled

b)

Count & For Controlled

c)

While & Sentinel Controlled

d)

Sentinel & Selection Controlled

30.

Which of the following correctly creates a variable?

a)

DIM age AS x

b)

DECLARE age AS INTEGER

c)

DECLARE CORRECT AS string

d)

INPUT user's full name

31.

What does the following pseudocode snippet do?


DECLARE car AS STRING

a)

It creates a character variable named car.

b)

Creates a new car object.

c)

Nothing

d)

It creates an address in memory which is referenced by the label car.

32.

What does the following pseudocode snippet do?


car <- "Honda"

a)

Assigns car to Honda.

b)

Assigns a string value to car.

c)

Assigns an integer value to car.

d)

Nothing.

33.

What is a CHAR datatype?

a)

A datatype that can hold any single character.

b)

A datatype that can hold only numbers.

c)

A datatype that can hold a set of characters.

d)

A datatype that can hold only letters

34.

What is a STRING datatype?

a)

It can store a sequence of numbers.

b)

It can store a sequence of characters.

c)

It can store a sequence of letters.

d)

All of the above.

35.
a)

x is equal to "yes"; y is equal to "maybe"; z is equal to "no"

b)

x is equal to "no"; y is equal to "maybe"; z is equal to "yes"

c)

x is equal to "no"; y is equal to "maybe"; z is equal to "x"

d)

x is equal to "yes, no"; y is equal to "yes, maybe"; z is equal to "yes, no"

e)

x is equal to "no"; y is equal to "maybe"; z is equal to "no"

Answer

36.
a)

Makes sure the value of x is not equal to 10

b)

Makes sure the value of x is less than 5

c)

Makes sure the value of x is between 10 and 5

d)

It always sets x equal to 5

e)

This code will cause an error

37.
a)

x is equal to 8; y is equal to 8; z is equal to 12

b)

x is equal to 8; y is equal to 4; z is equal to 84

c)

x is equal to 8; y is equal to 8; z is equal to 16

d)

x is equal to 8; y is equal to 8; z is equal to "x + y"

e)

x is equal to 8; y is equal to 4, 8; z is equal to 12

38.
a)

apple

apple

apple

orange

orange

orange

b)

apple

orange

c)

apple

orange

apple

orange

apple

orange

d)

Nothing will be printed

e)

It will be different each time you run it

39.
a)

Under 40

b)

And under 21

c)

And contains a 3

d)

Under 40

And contains a 3

e)

Under 40

And under 21

And contains a 3

40.

Which of the following statement describes a logic error?

a)

The program has run out of memory

b)

The steps to solve the problem are in the wrong sequence

c)

The incorrect terminology was used

d)

The program is stuck in a loop