Font size
WorksheetsOCR Computer Science Paper 2
Total questions: 66
Worksheet time: 35mins
A variable is...
A memory location used to store a value that can change.
A memory location used to store a value that cannot change
A constant is...
A memory location used to store a value that can change.
A memory location used to store a value that cannot change
'Sequence' means...
When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE
When lines of code loop e.g. WHILE, FOR
When lines of code runs one line after the other
'Selection' means...
When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE
When lines of code loop e.g. WHILE, FOR
When lines of code runs one line after the other
'Iteration' means...
When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE
When lines of code loop e.g. WHILE, FOR
When lines of code runs one line after the other
A STRING is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
An INTERGER is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
A FLOAT is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
A BOOLEAN value is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
The data value '4.5' would be a...
STRING
INTERGER
FLOAT
BOOLEAN
The data value 'Steve' would be a...
STRING
INTERGER
FLOAT
BOOLEAN
The data value '250' would be a...
STRING
INTERGER
FLOAT
BOOLEAN
The data value 'TRUE' would be a...
STRING
INTERGER
FLOAT
BOOLEAN
The data value 'Phone Number: 07284 281837' would be a...
STRING
INTERGER
FLOAT
BOOLEAN
'Casting' means...
Converting data types e.g. int(), str()
Removing unwanted data
Creating a new variable
Creating a new constant
file = open("textfile.txt", "r") means...
Open a file called 'textfile' and add to it.
Open a file called 'textfile', empty it and then write to it
Open a file called 'textfile' and read it.
file = open("textfile.txt", "a") means...
Open a file called 'textfile' and add to it.
Open a file called 'textfile', empty it and then write to it
Open a file called 'textfile' and read it.
file = open("textfile.txt", "w") means...
Open a file called 'textfile' and add to it.
Open a file called 'textfile', empty it and then write to it
Open a file called 'textfile' and read it.
SQL statements always use...
WHERE
FROM
SELECT
SELECT
FROM
WHERE
FROM
SELECT
WHERE
SELECT
WHERE
FROM
To create a sub program, we use:
We create a random number (between 1-6) with...
random = [1,2,3,4,5,6]
random1-6:
random.num(6)
random.randint(1,6)
The examples of maintainability below are... (select 3):
Comments in code
Indentation
Appropriate variable names
Abstraction
Changing an input so it works in a program (e.g. turning lowercase into uppercase)
Input Sanitation
Input Validation
Input Creation
Input Testing
Testing an input and ensuring it is in the correct format or range
Input Sanitation
Input Validation
Input Creation
Input Testing
Authentication means...
Checking a user is who they say they are (e.g. username/password)
Helping a piece of code become more readable
Testing a program while it is being created,
A syntax error means...
An error that still allows the code to run, however not as expected.
An error that prevents the code from running as it does not follow the code language rules.
A logic error means...
An error that still allows the code to run, however not as expected.
An error that prevents the code from running as it does not follow the code language rules.
prnit("Welcome to the Game")
is an example of a...
Logic Error
Syntax Error
score = 1
print("score")
is an example of a...
Logic Error
Syntax Error
The purpose of testing in programming is... (select 2):
To check that the program hits the user requirements
To save variables in the correct places in RAM
To add comments into the code
To check the code runs as expected.
Final/terminal testing takes place...
Many times throughout a programming project
At the end of a programming project
Iterative testing takes place...
Many times throughout a programming project
At the end of a programming project
Normal test data is used to...
Test a value that is just inside/outside of what should/shouldn't be accepted.
Test a value that is expected in a program and should work.
Test a value that should be rejected by the program.
Boundary test data is used to...
Test a value that is just inside/outside of what should/shouldn't be accepted.
Test a value that is expected in a program and should work.
Test a value that should be rejected by the program.
Erroneous test data is used to...
Test a value that is just inside/outside of what should/shouldn't be accepted.
Test a value that is expected in a program and should work.
Test a value that should be rejected by the program.
What logic gate is this?
AND
NOT
OR
What logic gate is this?
AND
NOT
OR
What logic gate is this?
AND
NOT
OR
If 1 is the input, the output will be...
0
1
If input A is 1, and input B is 1, the output will be...
0
1
If input A is 1 and input B is 0, the output will be...
0
1
DIV means...
Dividing without including the remainder
Dividing, but only writing the remainder
Multiplying the number by itself
MOD means...
Dividing without including the remainder
Dividing, but only writing the remainder
Multiplying the number by itself
^ means...
Dividing without including the remainder
Dividing, but only writing the remainder
Multiplying the number by itself
13 DIV 4 =
(a)
29 DIV 5 =
(a)
63 DIV 10 =
(a)
34 MOD 5 =
(a)
12 MOD 6 =
(a)
100 MOD 9 =
(a)
4^2 =
(a)
2^3 =
(a)
3^3 =
(a)
High-level language means...
A programming language that uses short and basic single words
A programming language that uses English-like words
1s and 0s - used by the CPU
Low-level language means...
A programming language that uses short and basic single words
A programming language that uses English-like words
1s and 0s - used by the CPU
Machine code means...
A programming language that uses short and basic single words
A programming language that uses English-like words
1s and 0s - used by the CPU
" score = input("Enter a number") "
is an example of...
High-level language
Low-level language
Machine code
INP 10
STA 12
OUT 28
is an example of...
High-level language
Low-level language
Machine code
1001 0101
0011 1111
0101 1110
is an example of...
High-level language
Low-level language
Machine code
A translator...
Tests an input and changes it to fit with the program (e.g. lowercase to uppercase)
Tests the code and checks for errors
Tells the program where the variables are stored in RAM
Converts high-level language into machine code so the CPU can run the program.
A complier translator... (select 2):
... is used during development of code
...is used at the end when the code is finished
...is quick and reports errors as is translates
...takes some time and produces a list of errors at the end
An interpreter translator... (select 2):
... is used during development of code
...is used at the end when the code is finished
...is quick and reports errors as is translates
...takes some time and produces a list of errors at the end
2 examples of IDE tools are...
Editor tools (e.g. line numbering, colour coding)
Selection (when lines of code run one after another)
Iteration (when lines of code loop)
Translators
2 examples of IDE tools are...
Variable names must be suitable and appropriately named.
Run-time environment (You can run the code before its finished)
Debugging tools (errors are reported and advice is given to the user)
Selection (lines of code only runs if a condition is met)
The user can input something using the code...
input("Enter a value")
print("Enter a value")
variable("Enter a value")
while("Enter a value")
We can output something using the code...
input("Hello")
print("Hello")
variable("Hello")
while("Hello")
