wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

OCR GCSE Computer Science Paper 2

Total questions: 72

Worksheet time: 36mins

Name
Class
Date
1.

Which of the following is not a data type?

a)

Boolean

b)

Print

c)

Integer

d)

String

2.

Which of the following code is used to cast a string to an integer?

a)

bool("False")

b)

str("False")

c)

integer("123")

d)

int("123")

3.

One of the following terms is not associated with programming construct

a)

Selection

b)

Iteration

c)

Loop

d)

Sequence

4.

Identify the code which outputs 10 numbers correctly

a)

for i in range(0,11)

b)

for i in range(0,10)

c)

for i in range(1,9)

d)

for i in range(1,10)

5.

Substring is used to?

a)

Extract a portion of characters from a string

b)

Print out a portion of a string

c)

Remove the left characters by a certain amount

d)

Allow you to change the upper case

6.

Which of the following is an iteration?

a)

IF (num > 3)

b)

For i in range(0, 5)

c)

age = int("21")

d)

students = ["Harry", "Ryan", "Ibrahim"]

7.

What is the purpose of an array?

a)

To store a value

b)

To store multiple values of any type

c)

To store programming code

d)

To store multiple values of the same data type

8.

Which of the following is the correct code to create an array to store some integers?

a)

age = (2, 3, 1)

b)

age = ["2", "3", "1"]

c)

age = ["2" "3" "1"]

d)

age = [2, 3, 1]

9.

What is the correct value after this calculation? 5 mod 2

a)

1

b)

2

c)

2.5

d)

3

10.

What is the correct value after this calculation? 5 div 2

a)

1

b)

2

c)

2.5

d)

3

11.

What is the purpose of the following code?

Hide Answers

a)

Opens a file for you to write into it

b)

Opens a file for you to read the first line

c)

Opens a file called name to store in an array

d)

Opens a file called name to store in an array

12.

Which of the following is not string manipulation?

a)

name.upper()

b)

name.lower()

c)

name.substring()

d)

name.remove()

13.

Describe what a function is?

a)

A block a code that does not return a value

b)

A block a code that returns a value

c)

A block of code to store multiple values in

d)

A type of iteration

14.

In the following code how many parameters are used?

a)

1

b)

2

c)

3

d)

4

15.

In the following code how many local variables are there?

a)

1

b)

2

c)

3

d)

4

16.

What is the most suitable data type to store someone's name?

a)

String

b)

Character

c)

Integer

d)

Boolean

17.

What is the most suitable data type to store the cost of an item?

a)

String

b)

Real/Float

c)

Integer

d)

Boolean

18.

What is the following value that will be extracted using the code?

a)

Mr

b)

Liu

c)

Com

d)

Sci

19.

Which of the following best describes a constant?

a)

A memory store that store data that can be changed during the program

b)

A memory store that store data that cannot be changed during the program

c)

A memory store to store the value of an integer

d)

A memory store to store the value of a string

20.

What type of error is in the following code?

a)

Syntax

b)

Logical

c)

Data Type error

d)

Sequence program

21.

What type of error is in the following code?

a)

Syntax

b)

Logical

c)

Data Type Error

d)

Sequence problem

22.

Which of the following is not a boolean operator?

a)

AND

b)

OR

c)

NOT

d)

IS

23.

What name will be printed?

a)

Messi

b)

Salah

c)

Mbappe

d)

Ronaldo

24.

What type of subprogram is the following?

a)

Function

b)

Array

c)

Iteration

d)

Procedure

25.

What type of subprogram is the following?

a)

Function

b)

Array

c)

Iteration

d)

Procedure

26.

What is the correct value that will be extracted from the following code?

a)

Salah

b)

Liverpool

c)

Ronaldo

d)

Man Utd

27.

What type of data structure is the following?

a)

Constant

b)

Variable

c)

1D Array

d)

2D Array

28.

The IF STATEMENT belongs to which programming construct?

a)

Selection

b)

Sequencing

c)

Iteration

d)

Data Structure

29.

The WHILE STATEMENT belongs to which programming construct?

a)

Selection

b)

Squencing

c)

Iteration

d)

Data Structure

30.

The REPEAT UNTIL OR DO WHILE STATEMENT belongs to which programming construct?

a)

Selection

b)

Sequencing

c)

Iteration

d)

Data Structure

31.

The FOR STATEMENT belongs to which programming construct?

a)

Selection

b)

Sequencing

c)

Iteration

d)

Data Structure

32.

Which of the following statements can be used with conjunction with print(i) to iterate and provide the correct iteration?

a)

for i in range(0, 9):

b)

for i in range(1, 10):

c)

for i in range(0, 11):

d)

for i in range(1, 9):

33.

Which of the following is classed as a counter controlled loop?

a)

for loop

b)

while loop

c)

do until loop

d)

If statement

34.

Which of the following is classed as a condition based loop?

a)

for loop

b)

while loop

c)

else statement

d)

if statement

35.

Which of the following is an algorithm for searching?

a)

Binary

b)

Bubble

c)

Merge

d)

Insertion

36.

Which of the following is an algorithm for searching?

a)

Linear

b)

Bubble

c)

Merge

d)

Insertion

37.

Which of the following is an algorithm for sorting?

a)

Linear

b)

Binary

c)

Merge

d)

Selection

38.

Which of the following is an algorithm for sorting?

a)

Linear

b)

Binary

c)

Bubble

d)

Selection

39.

Which of the following is an algorithm for sorting?

a)

Linear

b)

Binary

c)

Insertion

d)

Selection

40.

Which of the following can be used to help with maintainability?

a)

Use of sub programs

b)

Input validation

c)

Authentication

d)

Iterative Testing

41.

Which of the following can be used to help with maintainability?

a)

Naming conventions for variables

b)

Input validation

c)

Authentication

d)

Iterative Testing

42.

Which of the following can be used to help with maintainability?

a)

Commenting

b)

Input validation

c)

Authentication

d)

Iterative Testing

43.

Which of the following can be used to help with maintainability

a)

Indentation

b)

Input validation

c)

Authentication

d)

Iterative Testing

44.

What best describes the following? Testing while developing your program.

a)

Iterative Testing

b)

Use of sub programs

c)

Authentication

d)

Anticipating Misuse

45.

What best describes the following? Testing at the end of development.

a)

Final Testing

b)

Use of sub programs

c)

Authentication

d)

Anticipating Misuse

46.

Which of the following data would be classed as normal test data?

a)

17

b)

abc

c)

-1

d)

15

47.

Which of the following data would be classed as boundary test data?

a)

17

b)

abc

c)

-1

d)

15

48.

Which of the following data would be classed as invalid/erroneous test data?

a)

17

b)

abc

c)

-1

d)

15

49.

Which is the meaning of input validation?

a)

Checking whether the user can log in or not

b)

Checking if an input value fits in with the rules

c)

Checking if the input is maintainable

d)

Checking if the input is correct for test data

50.

Which of the SQL statements will correctly output one row of information?

a)

SELECT * FROM teachers WHERE year group > 7

b)

SELECT * FROM teachers WHERE subject = "Art" and subject = "Business"

c)

SELECT * FROM teachers WHERE subject = "Art"

d)

SELECT * FROM teachers WHERE name = "Mr Liu" or name = "Mr Prior"

51.

Which of the SQL statements will correctly output year groups between 12 and 13?

a)

SELECT * FROM teachers WHERE year group > 11 and year group < 14

b)

SELECT * FROM teachers WHERE year group > 7

c)

SELECT * FROM teachers WHERE year group > 12 and year group < 13

d)

SELECT * FROM teachers WHERE year group > "11" and year group < "14"

52.

Which of the following is classed as low level language?

a)

Machine Code

b)

Python

c)

C++

d)

Javascript

53.

Which of the following is classed as low level language?

a)

Assembly

b)

Python

c)

C++

d)

Javascript

54.

Which of the following is classed as high level language?

a)

Assembly

b)

Python

c)

Machine Code

d)

Binary

55.

Which is the purpose of a translator?

a)

To convert one language to another

b)

To validate data that has been entered

c)

To provide an environment for you to program

d)

Checking for authentication

56.

Compilers will....

a)

Convert source code in one go

b)

Convert source code line by line

c)

Convert source code so that it is maintainable

d)

Check for authentication

57.

Interpreter will....

a)

Convert source code in one go

b)

Convert source code line by line

c)

Convert source code so that it is maintainable

d)

Check for authentication

58.

IDE stands for?

a)

Information Development Environment

b)

Integrated Development Environment

c)

Integrated Design Environment

d)

Information Design Environment

59.

Editors are provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

60.

Translators are provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

61.

Error diagnostics are provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

62.

Run time environment is provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

63.

What is the following gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

64.

What is the following gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

65.

What is the following gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

66.

The following is a truth table for which gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

67.

The following is a truth table for which gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

68.

The following is a truth table for which gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

69.

The following is a truth table for which gate?

a)

AND

b)

OR

c)

NOT

d)

NAND

70.

What type of algorithm is the following?

a)

Bubble

b)

Merge

c)

Insertion

d)

Binary

71.

What type of algorithm is the following?

a)

Bubble

b)

Merge

c)

Insertion

d)

Binary

72.

What type of algorithm is the following?

a)

Bubble

b)

Merge

c)

Insertion

d)

Binary