wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Lesson 5 review

Total questions: 25

Worksheet time: 8mins

Name
Class
Date
1.
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. 
2.
Which of the following is the definition of pseudocode?
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. 
3.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
Which part is the identifier?
a)
10
b)
=
c)
distanceToSchool
4.
Which of the following assignment statements is assigning a number .
a)
myAge = 21
b)
myAge = "21"
5.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
6.

What would the program output with the following inputs?

Payrate - 12

Hours Worked - 10

a)

12

b)

Final pay

c)

OUTPUT

d)

120

7.

What are the two main categories of loop?

a)

Count & Condition (Event) Controlled

b)

Count & For Controlled

c)

While & Event Controlled

d)

Event & Selection Controlled

8.

We need variables to:

a)

store and manipulate data.

b)

store data.

c)

manipulate data.

d)

make fun of students.

9.

We need to give a variable a name so we can...

a)

assign and retrieve values from memory.

b)

be cool.

c)

read code.

d)

know what we're doing.

10.

Which of the following correctly assigns a value to an integer variable?

a)

STORE '5' IN x

b)

STORE 5 IN x

c)

INPUT x IN '5'

d)

STORE x IN 5

11.

A string is a collection of characters and also a data type (i.e. it tells us the type of data that can be stored in a variable). What kind of data can be stored in 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.

12.

Char is short for character, what type of data can be stored in 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 be ignored.

d)

A datatype that can fit 7.

13.

State the data type of the variable MyName

MyName = "Dhoni"

a)

CHAR

b)

STRING

c)

INTEGER

d)

REAL

e)

Honestly , I don't know

14.

What type of statement is demonstrated in the following example?


MyName = "Bill Gates"

a)

Sequence

b)

Selection

c)

Iteration

d)

Assignment

e)

Honestly , I don't know

15.

What type of data is being stored in the variable called Gender? Please refer to the statements below.


Gender = "F"

Gender = "M"

a)

STRING

b)

ARRAY

c)

CHAR

d)

INTEGER

e)

Honestly , I don't know

16.

What will be the output of the following code?


A = 23

B = 12

C = 2

D = (A+B) * C

PRINT D

a)

47

b)

35

c)

70

d)

140

e)

Honestly , I don't know

17.

What will be the output for the following code?


A = 9

B = 1

C = 2

D = 3

E = A * C + B * D - A / D

PRINT E

a)

21

b)

17

c)

19

d)

18

e)

Honestly , I don't know

18.

What will be the output for the following code?


A = 9

B = 1

C = 2

D = 3

E = A *( C + B )* (D - A) / D

PRINT E

a)

Error

b)

-3

c)

-54

d)

4

e)

Honestly , I don't know

19.

A control structure which a statement or block is executed until the program reaches a certain state, or operations have been applied to every element of a collection.

a)

sequence

b)

iteration

c)

selection

d)

none of the above

20.

___________ is used to denote when a user has to give something to a program.

a)

GET

b)

OUTPUT

c)

INPUT

d)

GIVE

21.

____________ is used by programmers to display information from the screen to the user.

a)

START

b)

SHOW

c)

INPUT

d)

OUTPUT

22.

Which statement correctly indicates that 5 pieces of data will be entered into the computer?

a)

INPUT 1,2,3,4,5

b)

INPUT A,B,C,D,E

c)

INPUT 1,2,A,B,C

d)

INPUT 1A,2B,3C,4D,5E

23.

Which statement below demonstrates the correct use of a psuedocode input statement to get someone's age?

a)

INPUT age

b)

INPUT "age"

c)

age <- INPUT

d)

age = INPUT

24.

Which statement below demonstrates the correct use of a psuedocode output statement to get someone's age?

a)

OUTPUT "age"

b)

OUTPUT age

c)

age <- OUTPUT

d)

age = OUTPUT

25.

Which statement below demonstrates the correct use of a psuedocode assignment statement to store someone's age?

a)

age = 0

b)

age == 0

c)

0 <- age

d)

age <- 0