wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Section 5 - Part 2

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.
A variable is needed to record a student's surname. Which of the following would be the most meaningful variable name?
a)
name
b)
student_surname
c)
studentName
2.
Why are variables called "Variables"?
a)
Variables are so named because we can choose whether or not to use them
b)
Variables are so named because the data we store in them can change
c)
Variables are so named because we can change their names
3.
How can strings and variables be told apart?
a)
The data in a string is stored inside quotes
b)
By its name
c)
By its size
4.
In programming what name is given to the data type which represents any combination of characters on a keyboard?
a)
Integers
b)
Strings
c)
Floating point numbers
5.
In programming what name is given to the data type which represents decimal numbers?
a)
Integers
b)
Strings
c)
Floating point numbers
6.
In programming what name is given to the data type which represents whole numbers?
a)
Integers
b)
Strings
c)
Floating point numbers
7.
Which statement is used to specify a decimal number?
a)
int
b)
str
c)
float
8.
Which of the following statements would be used to obtain a value from the user?
a)
get
b)
input
c)
fetch
9.
In programming, what is iteration?
a)
The repetition of steps within a program
b)
The order in which instructions are carried out
c)
A decision point in a program
10.
Why is iteration important?
a)
It determines the order in which instructions are carried out
b)
It allows code to be simplified by removing duplicated steps
c)
It allows multiple paths through a program
11.
In programming, what is a statement?
a)
A statement is a block of code
b)
A statement is a repeated instruction
c)
A statement is a single instruction
12.
Which statements are used to implement iteration?
a)
IF...ELSE and WHILE
b)
DO and WHILE
c)
FOR and WHILE
13.
Which type of loop uses a counter?
a)
A repeat-many loop
b)
A condition-controlled loop
c)
A count-controlled loop
14.
Which type of loop iterates a specified number of times?
a)
A condition-controlled loop
b)
A count-controlled loop
c)
A repeat-once loop
15.
Which type of loop iterates until instructed otherwise?
a)
A condition-controlled loop
b)
A count-controlled loop
c)
A repeat-once loop
16.
What is the name given to a loop that continues indefinitely?
a)
An infinite loop
b)
A forever loop
c)
A continuous loop
17.
What is selection?
a)
Repeating a number of steps
b)
A decision point in a program
c)
The order in which instructions are carried out
18.
Why is selection important?
a)
Selection allows a number of steps to be repeated
b)
Selection allows multiple paths through a program
c)
Selection determines the order in which instructions are carried out
19.
What is a statement?
a)
A statement is a single instruction
b)
A statement is a block of code
c)
A statement is a repeated instruction
20.
In programming how is selection implemented?
a)
IF-OTHERWISE
b)
IF-ELSE
c)
DO-ELSE
21.
How many paths through a program does an IF statement allow?
a)
One path
b)
Three paths
c)
Two paths
22.
What does an IF statement represent?
a)
A question
b)
An answer
c)
An iteration
23.
Which statement is used to add further choices to a program in Python?
a)
ELSE IF
b)
DO OTHERWISE
c)
elif
24.
What does an ELSE statement represent?
a)
A question
b)
The path to follow when the answer to the question is True
c)
The path to follow when the answer to the question is False
25.
What does ELSE IF represent?
a)
An extra answer
b)
An extra choice
c)
An extra iteration
26.
In programming what is the answer to an IF question?
a)
In or Out
b)
Positive or Negative
c)
True or False
27.
What is Boolean logic?
a)
A form of algebra to help make decisions
b)
A mathematical way of representing iteration
c)
A mathematical way of representing sequence
28.
What does Boolean logic use?
a)
Functions
b)
Expressions
c)
Statements
29.
How is 'equals' represented in Boolean logic?
a)
" ! = "
b)
" > = "
c)
" = "
30.
How is 'equals to' represented in Python?
a)
" ! = = "
b)
" != "
c)
" = = "
31.
How is 'greater than' represented in Boolean logic?
a)
" > "
b)
" ^ "
c)
" = "
32.
What values does a Boolean expression have?
a)
1 or 2
b)
True or False
c)
Right or Wrong
33.
What is a data structure?
a)
A list of variables
b)
A list of variables and strings
c)
A facility that holds more than one value
34.
What is an array?
a)
A list of variables
b)
A list of strings
c)
A series of memory locations, each with the same name, that hold related data
35.
Why are arrays used?
a)
Arrays store multiple data values under one name, reducing the complexity of our program
b)
Arrays store more data than if we were using variables
c)
Arrays store more data than if we were using strings
36.
In an array, what is an element?
a)
The smallest number an array can hold
b)
The biggest number an array can hold
c)
An element is one value in an array
37.
How many elements would the array 'student_marks(10)' hold?
a)
Nine elements
b)
Ten elements
c)
Eleven elements. Because in lists we always count from 0
38.
What is the difference between an array and a list?
a)
An array holds numbers, whereas a list holds strings
b)
An array can only hold data of the same data type, whereas lists can hold values of different data types
c)
An array holds both numbers and strings, whereas a list only holds numbers
39.
In computer programming, what is a 'loop'?
a)
Something that is used to end a program
b)
Something that is continually repeated until a certain condition is reached
c)
Something that tells a program what to do
d)
Something that is required to load a program
40.
What is a programming variable?
a)
Mathematical calculations
b)
Rules that programme follows
c)
A program
d)
Something that stores information, such as text or a number
41.
What is a procedure?
a)
A set of iterated statements
b)
A small section of code within a program which performs a task
c)
A decision point in a program
42.
Why are procedures used?
a)
To make code more readable
b)
To reduce repetition of code
c)
To calculate values
43.
Why are functions used?
a)
To make code more readable
b)
To reduce repetition of code and to calculate a value
c)
To make decisions
44.
What is the difference between a procedure and a function?
a)
A procedure produces a calculated result whereas a function performs a task
b)
A procedure iterates code whereas a function is a decision point
c)
A procedure performs a task whereas a function produces a calculated result
45.
What statement is used to create a procedure or function?
a)
make
b)
ELIF
c)
def
46.
What term is given to running a procedure or function?
a)
Call
b)
Execute
c)
Perform
47.
What term is given to passing back of the value calculated in a function?
a)
Overwritten
b)
Returned
c)
Repeated
48.
Why is code indented in a procedure or a function?
a)
To show that it belongs within the procedure or function
b)
To make it more readable
c)
To show that it should be iterated
49.
What is a syntax error?
a)
A mistake in the logic of the program
b)
A spelling or grammatical mistake in the program
c)
A way of halting a program that is running
50.
When creating the array 'scores(9)', what does the '9' in brackets represent?
a)
The number of elements the array can hold
b)
The largest number of digits an element can hold
c)
The largest number of characters an element can hold