NEW
Font size
WorksheetsOCR GCSE Computer Science Paper 2
Total questions: 72
Worksheet time: 36mins
Which of the following is not a data type?
Boolean
Integer
String
Which of the following code is used to cast a string to an integer?
bool("False")
str("False")
integer("123")
int("123")
One of the following terms is not associated with programming construct
Selection
Iteration
Loop
Sequence
Identify the code which outputs 10 numbers correctly
for i in range(0,11)
for i in range(0,10)
for i in range(1,9)
for i in range(1,10)
Substring is used to?
Extract a portion of characters from a string
Print out a portion of a string
Remove the left characters by a certain amount
Allow you to change the upper case
Which of the following is an iteration?
IF (num > 3)
For i in range(0, 5)
age = int("21")
students = ["Harry", "Ryan", "Ibrahim"]
What is the purpose of an array?
To store a value
To store multiple values of any type
To store programming code
To store multiple values of the same data type
Which of the following is the correct code to create an array to store some integers?
age = (2, 3, 1)
age = ["2", "3", "1"]
age = ["2" "3" "1"]
age = [2, 3, 1]
What is the correct value after this calculation? 5 mod 2
1
2
2.5
3
What is the correct value after this calculation? 5 div 2
1
2
2.5
3
What is the purpose of the following code?
Hide Answers
Opens a file for you to write into it
Opens a file for you to read the first line
Opens a file called name to store in an array
Opens a file called name to store in an array
Which of the following is not string manipulation?
name.upper()
name.lower()
name.substring()
name.remove()
Describe what a function is?
A block a code that does not return a value
A block a code that returns a value
A block of code to store multiple values in
A type of iteration
In the following code how many parameters are used?
1
2
3
4
In the following code how many local variables are there?
1
2
3
4
What is the most suitable data type to store someone's name?
String
Character
Integer
Boolean
What is the most suitable data type to store the cost of an item?
String
Real/Float
Integer
Boolean
What is the following value that will be extracted using the code?
Mr
Liu
Com
Sci
Which of the following best describes a constant?
A memory store that store data that can be changed during the program
A memory store that store data that cannot be changed during the program
A memory store to store the value of an integer
A memory store to store the value of a string
What type of error is in the following code?
Syntax
Logical
Data Type error
Sequence program
What type of error is in the following code?
Syntax
Logical
Data Type Error
Sequence problem
Which of the following is not a boolean operator?
AND
OR
NOT
IS
What name will be printed?
Messi
Salah
Mbappe
Ronaldo
What type of subprogram is the following?
Function
Array
Iteration
Procedure
What type of subprogram is the following?
Function
Array
Iteration
Procedure
What is the correct value that will be extracted from the following code?
Salah
Liverpool
Ronaldo
Man Utd
What type of data structure is the following?
Constant
Variable
1D Array
2D Array
The IF STATEMENT belongs to which programming construct?
Selection
Sequencing
Iteration
Data Structure
The WHILE STATEMENT belongs to which programming construct?
Selection
Squencing
Iteration
Data Structure
The REPEAT UNTIL OR DO WHILE STATEMENT belongs to which programming construct?
Selection
Sequencing
Iteration
Data Structure
The FOR STATEMENT belongs to which programming construct?
Selection
Sequencing
Iteration
Data Structure
Which of the following statements can be used with conjunction with print(i) to iterate and provide the correct iteration?
for i in range(0, 9):
for i in range(1, 10):
for i in range(0, 11):
for i in range(1, 9):
Which of the following is classed as a counter controlled loop?
for loop
while loop
do until loop
If statement
Which of the following is classed as a condition based loop?
for loop
while loop
else statement
if statement
Which of the following is an algorithm for searching?
Binary
Bubble
Merge
Insertion
Which of the following is an algorithm for searching?
Linear
Bubble
Merge
Insertion
Which of the following is an algorithm for sorting?
Linear
Binary
Merge
Selection
Which of the following is an algorithm for sorting?
Linear
Binary
Bubble
Selection
Which of the following is an algorithm for sorting?
Linear
Binary
Insertion
Selection
Which of the following can be used to help with maintainability?
Use of sub programs
Input validation
Authentication
Iterative Testing
Which of the following can be used to help with maintainability?
Naming conventions for variables
Input validation
Authentication
Iterative Testing
Which of the following can be used to help with maintainability?
Commenting
Input validation
Authentication
Iterative Testing
Which of the following can be used to help with maintainability
Indentation
Input validation
Authentication
Iterative Testing
What best describes the following? Testing while developing your program.
Iterative Testing
Use of sub programs
Authentication
Anticipating Misuse
What best describes the following? Testing at the end of development.
Final Testing
Use of sub programs
Authentication
Anticipating Misuse
Which of the following data would be classed as normal test data?
17
abc
-1
15
Which of the following data would be classed as boundary test data?
17
abc
-1
15
Which of the following data would be classed as invalid/erroneous test data?
17
abc
-1
15
Which is the meaning of input validation?
Checking whether the user can log in or not
Checking if an input value fits in with the rules
Checking if the input is maintainable
Checking if the input is correct for test data
Which of the SQL statements will correctly output one row of information?
SELECT * FROM teachers WHERE year group > 7
SELECT * FROM teachers WHERE subject = "Art" and subject = "Business"
SELECT * FROM teachers WHERE subject = "Art"
SELECT * FROM teachers WHERE name = "Mr Liu" or name = "Mr Prior"
Which of the SQL statements will correctly output year groups between 12 and 13?
SELECT * FROM teachers WHERE year group > 11 and year group < 14
SELECT * FROM teachers WHERE year group > 7
SELECT * FROM teachers WHERE year group > 12 and year group < 13
SELECT * FROM teachers WHERE year group > "11" and year group < "14"
Which of the following is classed as low level language?
Machine Code
Python
C++
Javascript
Which of the following is classed as low level language?
Assembly
Python
C++
Javascript
Which of the following is classed as high level language?
Assembly
Python
Machine Code
Binary
Which is the purpose of a translator?
To convert one language to another
To validate data that has been entered
To provide an environment for you to program
Checking for authentication
Compilers will....
Convert source code in one go
Convert source code line by line
Convert source code so that it is maintainable
Check for authentication
Interpreter will....
Convert source code in one go
Convert source code line by line
Convert source code so that it is maintainable
Check for authentication
IDE stands for?
Information Development Environment
Integrated Development Environment
Integrated Design Environment
Information Design Environment
Editors are provided within an IDE what are they used for?
To input source code
To check for errors
To compile your program
To provide tools such as variable tracing and breakpoints
Translators are provided within an IDE what are they used for?
To input source code
To check for errors
To compile your program
To provide tools such as variable tracing and breakpoints
Error diagnostics are provided within an IDE what are they used for?
To input source code
To check for errors
To compile your program
To provide tools such as variable tracing and breakpoints
Run time environment is provided within an IDE what are they used for?
To input source code
To check for errors
To compile your program
To provide tools such as variable tracing and breakpoints
What is the following gate?
AND
OR
NOT
NAND
What is the following gate?
AND
OR
NOT
NAND
What is the following gate?
AND
OR
NOT
NAND
The following is a truth table for which gate?
AND
OR
NOT
NAND
The following is a truth table for which gate?
AND
OR
NOT
NAND
The following is a truth table for which gate?
AND
OR
NOT
NAND
The following is a truth table for which gate?
AND
OR
NOT
NAND
What type of algorithm is the following?
Bubble
Merge
Insertion
Binary
What type of algorithm is the following?
Bubble
Merge
Insertion
Binary
What type of algorithm is the following?
Bubble
Merge
Insertion
Binary
