Font size
WorksheetsOcr GCSE Computer Science
Total questions: 91
Worksheet time: 47mins
(a) is a check made by a computer to ensure that the data entered is sensible or reasonable.
What type of validation would be used on a field to enter a mobile phone number to ensure it contains 11 digits
Spell check
Lookup table
Presence check
Length check
What type of validation would be used on a field to check that data has been entered?
Spell check
Lookup table
Presence check
Length check
What type of validation is when the last one or two digits in a code are used to check the other digits are correct?
Spell check
Check digit
Presence check
Length check
What type of validation is used to check that a value falls within the specified range
Spell check
Range check
Presence check
Length check
What type of validation should be used to ensure a National Insurance number is in the form LL 99 99 99 L where L is any letter and 9 is any number?
Format check
Range check
Presence check
Length check
Another method for validating data and stopping attacks is to clean up the data that is inputted so that it is ready for the application to use.
(a) trims or strips strings, removing unwanted characters from strings
Which one of the following inputs for an email address would not require data santisation?
dave.smith@company.c
d.s@company.com
dave@smith@company.com
dave smith@company.com
(a) will consider and anticipate misuse.
Misuse may be in the form of a brute force attack on the program
(a) is a coding method to check that a user is who they say they are and allowed to access the program.
New software often requires a key code which is generated by an app on the user's phone and then entered.
Online banking requires a user to enter credentials into a webpage and then a number is generated which is entered into a key device.
This returns a number code which is entered into the webpage as well.
Without the second part of the code the user is not authenticated.
What process is this describing?
(a)
Tick two methods to provide information for future users or programmers that may be required to maintain the code.
Complex code
Indentation
Comments
Concise variable name
Who is this?
Ada Lovelace
Grace Hopper
Margaret Hamilton
Dorothy Vaughan
What term did she famously coin for finding a fault in a program?
error
syntax flaw
moth
bug
What type of errors may cause program errors or the computer to crash even if there appears to be nothing wrong with the program code?
Syntax errors
Runtime errors
Logic errors
Memory errors
What type of errors are mistakes in the way that the code is written?
Syntax errors
Runtime errors
Logic errors
Memory errors
What type of error is a bug in a program that causes it to operate incorrectly, but not to terminate or crash?
Syntax errors
Runtime errors
Logic errors
Memory errors
Identify the type of error in the pseudocode
Syntax error
Runtime error
Logic error
Memory error
Identify the type of error in the pseudocode
Syntax error
Runtime error
Logic error
Memory error
Identify the type of error in the pseudocode
Syntax error
Runtime error
Logic error
Memory error
What are the two types of testing discussed at GCSE?
Alpha testing
Beta testing
Iterative testing
Final / terminal testing
When testing a program that checks the weight of cabin baggage is less than or equal to 23kg, which of the following would be valid data?
10kg
22kg
23kg
24kg
100kg
When testing a program that checks the weight of cabin baggage is less than or equal to 23kg, which of the following would be invalid data?
10kg
22kg
23kg
24kg
100kg
When testing a program that checks the weight of cabin baggage is less than or equal to 23kg, which of the following would be boundary data?
10kg
22kg
23kg
24kg
100kg
Which of the following would you expect to find in a Test Plan?
The test number
The data entered
The type of test data
The expected outcome
The result of the test
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")
