wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OCR Paper 2 Revision

Total questions: 100

Worksheet time: 53mins

Name
Class
Date
1.

Identify the search algorithm

a)

Random search

b)

Binary search

c)

Denary search

d)

Next Item search

2.

Identify the description of a linear search

a)

Put the elements in order, check each item in turn

b)

Put the elements in order, compare to 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

3.

Identify the description of a binary search

a)

Put the elements in order, check each item in turn

b)

Put the elements in order, compare to 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

4.

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

5.

Which of the following is not a component of computational thinking?

a)

Abstraction

b)

Decomposition

c)

Typing

d)

Algorithmic thinking

6.

A linear search is to be performed on the list, how many comparisons would it take to find the number 1?

a)

1

b)

2

c)

3

d)

4

7.

A binary search is to be performed on the list, how many comparisons would it take to find the number 9?

a)

0-1

b)

2-3

c)

4-5

d)

It can't find the number 9

8.

Identify the search performed by the algorithm:

a)

Linear

b)

Binary

c)

Both linear and binary

d)

Neither, it does not work

9.

Which of the following is not a sorting algorithm?

a)

Bubble

b)

Insertion

c)

Binary

d)

Merge

10.

Which sorting algorithm is described by: moving through a list repeatedly, swapping elements that are in the wrong order.

a)

Merge

b)

Bubble

c)

Insertion

d)

None of the above

11.

Which sorting algorithm is described by: split a list into individual lists, then combine these, two lists at a time.

a)

Merge

b)

Bubble

c)

Insertion

d)

None of the above

12.

Which sorting algorithm is described by: take each item in turn, compare it to the items in the sorted list and place it in the ordered position in the sorted list.

a)

Merge

b)

Bubble

c)

Insertion

d)

None of the above

13.

The two lists are to be merged, which element first goes into the new merged list

a)

0

b)

1

c)

2

d)

3

14.

The list is to be sorted using a bubble sort. What will the list look like after the first iteration through the list.

a)
b)
c)
d)
15.

Which sorting algorithm needs to go through the list repeatedly?

a)

Merge

b)

Bubble

c)

Insertion

d)

None of them do

16.

Which sorting algorithm splits a list of items into individual lists.

a)

Merge

b)

Bubble

c)

Insertion

d)

None of them do

17.
What is the purpose of a rectangle within a flowchart?
a)

Process

b)
Input / Output
c)
Decision
d)
Start / Stop
18.
What is the purpose of a diamond in a flowchart?
a)
Process
b)
Input / Output
c)
Sub-process
d)
Decision
19.

What is this flowchart symbol called?

a)

connector

b)

decision box

c)

process box

d)

subroutine box

20.

Which of the following is not a type of test data?

a)

Check

b)

Normal

c)

Invalid

d)

Boundary

21.

Boundary tests check the minimum and maximum values of an input.

a)

True

b)

False

22.

What is iterative testing?

a)

Testing completed after an error is found

b)

Rom tests on a computer program

c)

Tests completed as the program is being coded

d)

Tests which are planned

23.

Terminal testing is.....

a)

when you test code from a networked terminal

b)

when a terminal error causes the code to crash

c)

when to carry out final testing when the code is complete

d)

when you code is so bad to need to delete it and start again

24.
Q8: A program runs & asks the user to enter their age. Which is erroneous test data? (1-3)
a)
44
b)
1
c)
97
d)
Forty Five
25.
A program won't run if there is a logic error.
a)
False
b)
True
26.

What type of error would result from you attempting to find the area of a circle, but you end up using the wrong equation.

a)

Logic Error

b)

Semantics Error

c)

Syntax Error

27.

Which of the following is a syntax error?

a)

Attempting to divide by 0

b)

Forgetting a colon at the end of a statement where one is required.

c)

Forgetting to divide by 100 when printing a percentage amount.

28.

A user attempts to enter in an incorrect password, what method would identify this issues?

a)

Data Validation

b)

Authentication

c)

Program Comments

d)

Indentation

29.

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

30.

Leo wants to create a subroutine that will roll a dice. Which syntax is correct?

a)

def dice roll ():

b)

def diceroll ()

c)

def diceroll ():

d)

def diceroll []:

31.

Which of the following Validation Checks is the most suitable for checking a text box has been filled in?

a)

Range Check

b)

Presence Check

c)

Format Check

d)

Check Digit

32.

What are the features of 'Well-Maintained Code'?

a)

Comments and global variables.

b)

No indentation.

c)

Comments, indentation and suitably named variables.

d)

Local variables only.

33.

A user attempts to enter in an incorrect password, what method would identify this issues?

a)

Data Validation

b)

Authentication

c)

Program Comments

d)

Indentation

34.

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

35.

What is the correct term for word shown in brackets?

a)

Argument

b)

Function

c)

Variable

d)

Parameter

36.

Which of the following statements about the program shown here, is true?

a)

This program uses a subroutine

b)

This program uses a function

c)

This program uses parameters

d)

This program uses arguments

37.

Complete the following sentence by choosing the correct (most appropriate) word from below


"To get a subprogram to run, we have to ________ it from somewhere in the program

a)

RUN

b)

CALL

c)

PERFORM

d)

EXECUTE

38.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
39.
What will print?
a)
nothing
b)
sayHi()
c)
an error message
d)
hi there
40.

What is the difference between a subroutine and a function?

a)

They are the same thing

b)

A subroutine passes values back out to the program, a function does not

c)

A function passes values back out to the program, a subroutine does not

d)

A function can run without being called

41.

While defining a function which of the

following symbols is used at the end of the line of code?

a)

;

b)

.

c)

$

d)

:

42.

When a program runs it asks the user to enter their full name. Which is an example of Valid data?

a)

Mr Jones

b)

Sarah

c)

Sarah Jones

d)

Mrs Jones

43.

What is maintainability?

a)

Checking programs work

b)

Making your code easy to follow, e.g. with comments

c)

Testing a program for errors

d)

Training staff to use the program correctly

44.

Which of these is not a method for authenticating a user?

a)

Password

b)

Password and Username

c)

Finger print scanner

d)

Encryption

45.

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

46.

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

47.

The output is the opposite of the input.

a)

NOT gate

b)

OR gate

c)

AND gate

d)

NOR gate

e)

NAND gate

48.

The symbol for NOT in a Boolean expression.

a)

¬

b)

^

c)

v

49.

The symbol for AND in a Boolean expression.

a)

^

b)

v

c)

¬

50.

The symbol for OR in a Boolean expression.

a)

v

b)

^

c)

¬

51.

What is this diagram called?

a)

Truth Table

b)

Gate Table

c)

Output Table

d)

Input Table

52.
A data type that represents true or false.
a)
Boolean
b)
Character
c)
Integer
d)
Float
e)
String
53.

What is the boolean expression for this logic circuit?

a)

Q = NOT (A OR B)

b)

Q = NOT A AND B

c)

NOT A OR B = Q

d)

Q = (NOT A) OR B

54.

This is the truth table for which logic gate?

a)
b)
c)
55.

Which of these are boolean operators, implemented in the computer as logic gates?

Check all that apply

a)

NOT

b)

MOD

c)

OR

d)

AND

e)

DIV

56.

In this logic circuit, what is the output Q if the inputs A and C are 1?

a)

0

b)

We can't say

c)

1

57.

This is the truth table for which logic gate?

a)

AND

b)

OR

c)

NOT

58.

Translates low level assembly language mnemonic into machine code

a)

Assembler

b)

Compiler

c)

Interpreter

59.

Translates source code from high level languages into object code and then into machine code

a)

Assembler

b)

Compiler

c)

Interpreter

60.

Program is translated line by line as the program is running

a)

Assembler

b)

Compiler

c)

Interpreter

61.

What is a MNEMONIC?

a)

A single action that can be performed by a computer.

b)

A symbol/short phrase that represents an instruction in assembly code.

c)

A high level language keyword.

d)

A register used inside a CPU A register used inside a CPU.

62.

Which of the following is NOT a translator?

a)

Assembler

b)

Compiler

c)

Interpreter

d)

Executable

63.

What is machine code?

a)

Instructions and data in binary

b)

Serial number of the CPU

c)

Instructions and data in human readable form

d)

Instructions and data in assembly code mnemonics

64.

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 programs to machine code

65.

Why do we need translators?

a)

Computers only understand program's in assembly code.

b)

Computers only understand program's in high-level language.

c)

Computers only understand Norwegian.

d)

Computers only understand program's in machine language.

66.

You do not get access to the source code with compiled code.

a)

True

b)

False

67.

This is where the code is written.

a)

Translator

b)

Run time environment

c)

Editor

d)

Error diagnostics

e)

Notepad

68.
Which type of code is assembly language?
a)
High level code
b)
Low level code
69.

Uses Mnemonics as command words (for example LDA, STA and ADD)

a)

High level code

b)

Low level code

c)

Assembly language

70.
Breakpoints are an example of
a)
A debugging tool
b)
A run time environment tool
c)
An editing tool
71.

What does IDE stand for?

a)

Internal Development Environment

b)

Integrated Design Environment

c)

Internal Design Environment

d)

Integrated Development Environment

72.

Machine code is used in which generation of a programming language? (1-3)

a)

1st Generation

b)

2nd Generation

c)

3rd Generation

d)

4th Generation

73.
Quotation marks around a variable’s identifier imply that it is a:
a)
String
b)
Integer
c)
Character
d)
List
74.
This variable data type can only have True or False values:
a)
Boolean
b)
Integer
c)
True/False
d)
String
75.
Which of these lines of Python code will output the third item from a list called 'games'?
a)
print(games[2])
b)
print games(3)
c)
print(games[3])
d)
print (games(2))
76.

"Iteration" refers to...

a)

Storing data in variables

b)

Creating variables

c)

Repeating sections of code

d)

Checking a condition to see which piece of code to run next

77.

What is the term for a named block of code that can be executed by writing its name.

a)

Subroutine

b)

Condition

c)

Selection

78.

What is the correct way to start a procedure?

a)

def

b)

Def

c)

define

d)

(def)

79.

What is a benefit of using Subroutines?

a)

More efficient as the code is modularised

b)

Takes longer to write

c)

Makes the code look longer

d)

The program executes better

80.
Used to make comments
a)
#
b)
%
c)
**
d)
()
81.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
82.
What would the value of 'b' be when it is printed out? 
a)
1
b)
4
c)
5
d)
8
83.
This operator means that one value is not equal to another value
a)
==
b)
<=
c)
>=
d)
!=
84.
<
a)
greater than
b)
less than
c)
equal to
d)
less than or equal to
85.
>
a)
less than
b)
not equal to
c)
less than or equal to
d)
greater than
86.
<=
a)
less than
b)
less than or equal to
87.
>=
a)
greater than
b)
greater than or equal to
c)
not greater than
d)
not equal to
88.
Choose the correct Python code.
if age is less than 20 then
a)
if age > 20:
b)
if age < 20:
89.
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
d)
Testing a program to make sure it works
90.
a)
Hello world!
b)
Hello world
c)
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
d)
Error
91.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)

holds whole numbers

c)

holds a decimal point in a number

d)
hold either true or false
92.
Upper and lower case letters have a different ASCII code.
a)
True
b)
False
93.
What does the len() function do?
a)
Gets the length of a string or list
b)
Gets the character code for a character
c)
Converts a character into a character code
d)
Would you like a muffin?
94.
The character code for the letter 'e' is 101.
What is the character code for 'f'?
a)
102
b)
101.1
c)
42
d)
Would you like a baguette?
95.

Choose three properties of a variable

a)

Has a data type

b)

Has a value

c)

Has a name

d)

Has a length

e)

Has a return value

96.

Choose all the rules that are correct for naming variables

a)

Must not begin with a number

b)

Must only contain a-z and 0-9 characters

c)

Must have spaces

d)

Must be in lower case

97.

In what way is a constant different from a variable?

a)

It can not change its value during program execution

b)

It can store more than one value

c)

It can only be used in the global scope

d)

Its name must be written in UPPER CASE

98.

The process of giving a value to a variable?

a)

Assignment

b)

Initialisation

c)

Coercion

d)

Declaration

99.

Example of ... ?

a)

Selection

b)

IIteration

c)

Sequence

d)

Iteration

100.

A special type of loop that never ends?

a)

Infinite loop

b)

Recursive loop

c)

Nested loop

d)

Unconditional loop