wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MOCK Exam 2

Total questions: 80

Worksheet time: 42mins

Name
Class
Date
1.
Define what is meant by the term 'algorithm'
a)
Step by step instructions or rules to solve a problem.
b)
Code for a specific task.
2.

Which type of lists or data sets are linear searching algorithms used for?

a)

Unsorted lists or data sets

b)

Sorted lists or data sets

c)

Sorted or Unsorted lists or data sets

3.
Which type of lists or data sets are binary searching algorithms used for?
a)
Unsorted lists or data sets
b)
Sorted lists or data sets
4.
Select the best description to explain what a linear search algorithm is.
a)
Put the elements in order, check each item in turn.
b)
Put the elements in order, compare with the middle value, split the list in order and repeat.
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat
5.

Select the best description to explain what a binary search algorithm is.

a)

Put the elements in order, check each item in turn.

b)

Put the elements in order, compare with the middle value, split the list in order and repeat.

c)

Elements do not need to be in order, check each item in turn.

d)

Elements do not need to be in order, compare to the middle value, split the list in order and repeat

6.
Describe an advantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
7.
Describe a disadvantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
8.
Breaking a complex problem down into smaller problems and solving each one individually.
a)
Decomposition
b)
Abstraction
c)
Programming
d)
Algorithmic Thinking
9.
What is abstraction?
a)
The process of filtering out unnecessary detail.
b)
The process of filtering out irrelevant characteristics
c)
The process of filtering out irrelevant characteristics and unnecessary detail.
10.
Which sorting algorithm shifts elements instead of swapping elements if needed in each pass.
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
11.
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?
 
4    5    9    6    2    7

4    5    6    2    7    9 
4    5    2    6    7    9
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
12.
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?
 
4    8    6    2    5    7 
4    8    6    2    5    7 
4    6    8    2    5    7
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
13.

Define the term computational thinking

a)

Using a computer

b)

Developing an algorithm to solve a problem

c)

Making a computer use artificial intelligence

d)

Google is computational thinking

e)

Solving a problem using a computer

14.

Q9: This variable type can only have True or False values

a)

Boolean

b)

Integer

c)

String

d)

Character

15.
Q13: This function calculates the length of a string (4-6)
a)
UBOUND
b)
INDEX
c)
LEN
d)
COUNT
16.
Q14: The flowchart shape for selection is
a)
Parallelogram
b)
Square
c)
Diamond
d)
Rounded rectangle
17.

Which line of code lets us input a number?

a)

int(input("enter a number"))

b)

input("Enter a number")

c)

str(input("Enter a number"))

d)

import random

18.

6.Complete this sentence: ……………………… is used to execute a particular set of statements repeatedly until a condition is satisfied.

a)

Sequence

b)

Iteration

c)

Selection

d)

All of the above

19.

Q4: Which of the following is a valid keyword for output?

a)

PRINT

b)

SHOW

c)

DISPLAY

d)

INPUT

20.

In an assignment operation, what appears on the right hand side ?

a)

Variable identifier / name

b)

The assignment operator (=)

c)

data to be assigned

21.

Quotation marks around data implies the data type is?

a)

an integer

b)

a string

c)

a Boolean

d)

a real

22.

Casting refers to

a)

joining two strings together

b)

Converting one data type to another

23.

The operator used to divide and returns a INTEGER answer is?

a)

DIV (//)

b)

MOD (%)

c)

Division (/)

d)

**

24.

Which line of code lets us input a number?

a)

x = int(input("enter a number")

b)

x = input("enter a number")

c)

x = str(input("Enter a number"))

d)

x = int(input("enter a number"))

25.

What is the name of the sub-routine?

a)

say_my_name

b)

my_name

c)

name

d)

def

26.

What is the name of the parameter?

a)

say_my_name

b)

my_name

c)

name

d)

def

e)

There are none

27.
State whether this program uses sequence, selection or iteration
a)
Sequence
b)
Selection
c)
Iteration
28.
State whether this program uses sequence, selection or iteration
a)
Sequence
b)
Selection
c)
Iteration
29.
State whether this program uses sequence, selection or iteration
a)
Sequence
b)
Selection
c)
Iteration
30.

Which of these statements apply to the term 'variable'

a)

A named memory location that stores a value

b)

value cannot change whilst the program is running

c)

value can change whilst the program is running

31.

What is the name given to this common convention for variable names - FirstName

a)

Camel case

b)

Snake case

c)

Dog case

d)

Fish case

32.

What does the arithmetic operator do in this code: print(5**2)

a)

Division returning a real / float

b)

Division returning an integer

c)

Division returning the remainder

d)

Multiplying a number by itself (to the power of)

33.

What is the function of the operator == ?

a)

Equal to: Checks if two values are equal

b)

Not equal to: Checks if two values are not equal

c)

Assignment: Assigns data to a variable

d)

Greater than or equal to: Checks to see if one value is greater than or equal to another

34.
What is the function of the operator <=  ?
a)
Equal to: Checks if two values are equal
b)
Not equal to: Checks if two values are not equal
c)
Less than or equal to: Checks to see if one value is less than or equal to another
d)
Greater than or equal to:  Checks to see if one value is greater than or equal to another
35.
What is the function of the operator  != ?
a)
Equal to: Checks if two values are equal
b)
Not equal to: Checks if two values are not equal
c)
Less than or equal to: Checks to see if one value is less than or equal to another
d)
Greater than or equal to:  Checks to see if one value is greater than or equal to another
36.
What data type would you use to store the value of pi to 2 decimal places i.e. 3.14?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
37.
What data type would you use to store someone's age?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
38.
What data type would you use to store someone's name?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
39.
What programming concept is being shown in the image on Line 4?
a)
Concatenating
b)
Function
c)
Joiniating
d)
Merging
40.
File Handling: what does the last line of code do?
a)
Opens the files
b)
Closes the program
c)
Closes the file
d)
Writes to the file
41.
What is the index position of the element 'cantelope' in this 1 dimensional array?
a)
0
b)
1
c)
2
d)
3
42.
What does print(fruits[0:3]) output?
a)
apple, cantelope, satsuma
b)
apple, cantelope, satsuma and orange
c)
apple, cantelope
d)
app
43.

Which of the following key terms are evidenced in the image?

a)

Function

b)

Procedure

c)

Parameter

d)

Variable

e)

Iteration

44.

Concatenation refers to

a)

joining two strings together

b)

Converting one data type to another

45.

Which of these statements apply to the term 'constant'

a)

A named memory location that stores a value

b)

value cannot change whilst the program is running

c)

value can change whilst the program is running

46.

8 != 9 AND 20>3

a)

True

b)

False

47.

NOT ( 7*2 == 14 )

a)

True

b)

False

48.

What would the SQL query pictured do?

a)

Find all the men

b)

Find all of the female writers

c)

Find all of Elgar's friends

d)

Find all the male writers

e)

Find all the fish

49.

Which of these is not a method for ensuring a program is robust?

a)

Keeping passwords safe

b)

Data Validation

c)

Authentication

d)

Data Sanitisation

e)

Testing

50.

Why is code indented?

a)

To improve structure of code

b)

To show which lines of code are related to others

c)

To make it easier to read

d)

All of the above

51.

What is data validation?

a)

Checking that the data entered is wrong

b)

Checking that the data entered is correct

c)

Checking that the data entered is sensible or reasonable

52.

When should comments be used within a program?

a)

To help describe what certain lines of code & structures are expected to do

b)

To remind the developer of when lunch is

c)

To include what tests must be carried out on the code

d)

Every line, so that you know exactly what is happening

53.

When is terminal testing carried out?

a)

Before you start

b)

At the end

c)

During the project

d)

After the design section

54.

What is iterative testing?

a)

Testing completed after an error is found

b)

Tests which are planned

c)

Tests completed as the program is being coded

55.

A program runs & asks the user to enter their age. Which is erroneous test data?

a)

44

b)

1

c)

97

d)

Forty Five

56.

Which validation check makes sure that the data field cannot be left empty.

a)

Presence check

b)

List check

c)

Range check

d)

Type check

e)

Format check

57.

Which method of validation checks that only certain data types can be used e.g. string/int?

a)

Presence check

b)

List check

c)

Range check

d)

Type check

e)

Format check

58.

Which validation check makes sure that the user enters the correct number of characters required.

a)

Presence check

b)

List check

c)

Length check

d)

Type check

e)

Format check

59.

What is the output of an OR gate if the inputs are 1 and 0?

a)

0

b)

1

c)

OFF

d)

2

60.

What is the output of an AND gate if the inputs are 1 and 0?

a)

ON

b)

2

c)

1

d)

0

61.

What is the output of a NOT gate if the input is 0?

a)

1

b)

0

c)

OFF

d)

2

62.

A computer is made up of.......

a)

A motherboard, keyboard, mouse and joystick

b)

Transistors which act as switches with two states : on and off

63.

Both inputs must be true for the output to be true

a)

AND gate

b)

OR gate

c)

NOT gate

d)

NOR gate

e)

NAND gate

64.

Either inputs or both can be true for output to be true

a)

OR gate

b)

AND gate

c)

NOT gate

d)

NOR gate

e)

NAND gate

65.

The symbol for NOT in a Boolean expression.

a)

¬

b)

^

c)

v

66.

The symbol for AND in a Boolean expression.

a)

^

b)

v

c)

¬

67.

The symbol for OR in a Boolean expression.

a)

v

b)

^

c)

¬

68.

Which logic gate is represented by the truth table shown here?

a)

AND

b)

OR

c)

NOT

69.

Which logic gate is represented by the truth table shown here?:

a)

AND

b)

OR

c)

NOT

70.

What is assembly code?

a)

Another name for machine code

b)

High-level programming language

c)

Low-level programming language

d)

sit in forms, be quiet, listen to Miss Boyd

71.

What does a translator do?

a)

Swaps between different high-level languages

b)

Swaps between different machine code types

c)

Converts pseudocode to machine code

d)

Converts high level language to machine code

72.

Which of the following is NOT a translator?

a)

Assembler

b)

Compiler

c)

Interpreter

d)

Executable

73.

It translates the whole program into machine code before it runs.

a)

Assembler

b)

Compiler

c)

Interpreter

d)

Linker

74.

It translates code into machine code instruction by instruction.

a)

Assembler

b)

Compiler

c)

Interpreter

d)

Linker

75.

It translates assembly code into machine code.

a)

Assembler

b)

Compiler

c)

Interpreter

d)

Linker

76.
Compilers produce executable files.
a)
True
b)
False
77.

Embedded systems use

a)

High Level Code

b)

Machine Code

c)

Assembly Language

d)

Low Level Language

78.

IDE's contain a ________ environment which allows you to execute the program

a)

runtime

b)

outtime

c)

walktime

d)

linetime

79.

Which of the following is NOT part of an IDE?

a)

Debugger

b)

Communicator

c)

Code Editor

d)

Run-time environment

80.

What does IDE stand for?

a)

Internal Development Environment

b)

Integrated Design Environment

c)

I Dance Energetically

d)

Integrated Development Environment