WorksheetsMEGA OCR Computer Science Component 2 Quiz
Total questions: 130
Worksheet time: 1hrs 22mins
List 1
2 4 8 9
List 2
1 6 8 4
12 6 8 1 3
What will the list look like after the first iteration through the list?
Identify the correct algorithm
Num2=input("Enter the second number")
num3=num1+num2
print(Num3)
num2=input("Enter the second number")
num3=num1+num2
print(num3)
num3=input("Enter the secon number")
num3=num1+num2
print(num3)
num2=input("Enter the second number")
num3=num1+num2
print(num2)
Identify the correct algorithm
for x = 1 to 12
print(number*x)
next x
for x = 0 to 12
print(number * x)
next x
for x = 1 to 12
print(number X x)
next x
for x = 1 to 12
print(number*number)
next x
Why is code indented?
To group together a function
To make it easier to identify blocks of code as part of the same logical structure
To make it easier to read
All answers are correct
What is data validation?
Checking that the data entered is wrong
Checking that the data entered is correct
Checking that the data entered is sensible or reasonable
Checking that an input meets certain criteria
Confirming that someone is who they say they are
Which is these IS NOT an example of validation?
Checking the number entered is 2 digits
Asking a user to enter the same data in twice
Use of a Lookup table
Use of a presence check
What does a range check do?
Checks data across a range of numbers
Checks the data is within an acceptable range
Where three types of data are used
Checks that the data is in the correct format
When a program runs it asks the user to enter their full name. Which of these answers is an example of Valid data?
Mr Jones
Sarah
Sarah Jones
Mrs S Jones
Which of these is a NOT method of authentication?
Password
Password and Username
Pattern Password
Finger print password
What is Maintainability?
Checking programs work
Updating code so that it is compatible with current requirements
Testing a program for errors
Training staff to use the program correctly
Which of these is NOT a method for planning for misuse?
Stripping unwanted characters
Removing duplicated letters
Converting lowercase to uppercase Letters
Converting large numbers to smaller numbers.
Calculating answers from formula
Which of these is not a method for authenticating a user?
Password
Password and Username
Finger print scanner
Encryption
Why are comments used in a program?
They are required to make the program run
Comments pad out the program and make it look more professional
To keep programmers aware of any program errors and issues
To help security in the code
When should comments be used within a program?
To help describe what the code and structures are expected to do
To remind the developer of when lunch is
To include what tests must be carried out on the code
Every line, so that you know exactly what is happening
What is defensive programming design?
Making your code / program error free
Creating code that is easy to use and understand
A method of ensuring that your code is not misused
Code where the data is validated
A user attempts to enter in an incorrect password, what method would identify this issue?
Data Validation
Authentication
Program Comments
Indentation
A user enters in extra data attempting to access the system, such as we've seen in an SQL Injection. Which method would identify and help to prevent this issue?
Data Validation
Input Sanitisation
Input Check
Format Check
A program has a section of code that could cause errors, which method could be used to identify this issue?
Maintainability
Authentication
Program Comments
Indentation
What is the difference between Data Validation and Input
Sanitsation?
Nothing, they are the same
Data Validation checks the data is reasonable and Sanitsation removes unexpected or unrequired data
Data Validation checks the data is correct and Sanitsation removes data that contains errors
Sanitisation checks the data is correct and Validation removes invalid data
Calculating answers from formula
When is terminal testing carried out?
Before you start
At the end
During the project
After the design section
When is a run-time error identified?
After the program is executed
Before a program runs
While the program runs
Which line contains a syntax error?
print (“hello”)
print(“Hello”)
print(“hello)
print(“HELLO”)
What is iterative testing?
Testing completed after an error is found
Random tests on a computer program
Tests completed as the program is being coded
Tests which are planned
When a program runs it asks the user to enter their age. Which data would be most suitable to test for an incorrect piece of data being entered?
44
1
97
Forty five
Consider a test plan, what comes after the Expected Result of a test?
The actual result of the test
The data that is to be entered
The type of data type
An example of the data used
Testing while coding a program is called?
Developmental testing
Coder testing
Terminal testing
Iterative testing
What is a null value test on data entry?
Data that does not have a value such as a name or phone number
Data that is not entered in order to test how the program responds
Data that has a value of zero (0)
Data that is incorrect
What is the purpose of testing?
To identify errors
To identify issues that may occur when a customer uses the program
To test the security of the program
All answers are correct
