Font size
WorksheetsAQA 8525 GCSE CS 3.2.10 Subroutines & 3.2.11 Robust & Secure
Total questions: 50
Worksheet time: 50mins
A subroutine is a block of code that can be executed by (a) it from the program?
When a subroutine has finished executing its code...
the program will continue with the next line of programming code after the line that goes to the subroutine
the program will end even if there are more lines of code after the subroutine was used
the program will return to the start regardless of wherever it reached when the subroutine was referenced
the program will run any remaining subroutines, ignoring any other code remaining in the program
procedures and functions are both types of...
subroutines
selection
iteration
sequence
Compared to functions, Procedures do not return a...
value
variable
virus
valuation
Functions always return a...
value
vector
version
valuation
Here is a procedure, what does it do?
Displays a company's name and address on the screen
Saves a company's name and address in a file
Returns a company's name and address as a value to the program
Slices a company's name and address
In this simple function, what will be returned if the user enters a=24, b=8
16
3
32
192
On which line of this simple function, is there an error?
1
2
4
5
Subroutines defined by the user are called...
custom-made subroutines
tailored subroutines
manmade subroutines
user-selected subroutines
A subroutine is like a (a) - what happens inside is not seen by the rest of the program.
To use different values in subroutines, data can be passed into the subroutine using...
arguments
parameters
variables
constants
In pseudo-code, the value to be passed back to the main program from a function must be declared using...
PASSBACK
CONTINUE
RETURN
EXIT
A function is applied by assigning its result to a variable or by using it as part of an...
formula
constant
value
expression
"Functions can be particularly useful when they include several lines of code represented in a single code word"
True
False
A slicing function would take as its parameters...
name of the string, start and end characters of the slice
start and end characters of the slice
name of the string, end character of the slice
name of the string, number of characters in the slice
Any variables declared within the main part of the program are known as...
pseudo variables
local variables
global variables
whole variables
Global variables are available to...
the main program only
the subroutines only
the pseudo-code only
every part of the program
"Global variables waste memory"
True
False
"When a subroutine is executed, all local variables are added to memory with their previous values"
True
False
A subroutine's name is known as its...
call-name
identifier
sub-name
return
Modularised programming refers to creating code according to which aspect of computational thinking
decomposition
abstraction
arithmetic
algorithms
With subroutines, the detail of each subroutine is removed from the main program. This computational thinking aspect is known as...
decomposition
slicing
abstraction
generalisation
Validation means...
ensuring the data is true
ensuring the data is accurate
ensuring the data is correct
ensuring the data meets allowed criteria
An error message will usually inform the user if the input data is not acceptable to the system
True
False
A presence check ensures that...
data is of the required length
data has been entered in the field
data is within a number range
data is of the correct data type
Ensuring data entered matches a particular pattern is a...
Pattern check
Range check
Format check
Type check
Which type of validation checks to see if data entered exists in a list?
Lookup check
Format check
Type check
Presence check
Validation ensures that valid data is accepted and (a) data is rejected.
The process of checking that a user is who they say they are is known as...
validation
authentication
testing
accuracy
User names and passwords for multi-user authentication could be stored in...
a two-dimensional array
a multi-dictionary
a list of lists
a simple list
Trying to find if there are, or there are not errors within a software solution is known as...
authentication
validation
generalisation
testing
Testing is carried out on code for what reasons? (choose two)
checking it performs as expected
checking it meets requirements
checking it runs as fast as expected
checking it's compiled into machine code
Test data that is typically acceptable to a validation rule is known as...
diverse data
boundary data
normal data
erroneous data
Test data that would be rejected by a program is known as...
erroneous data
normal data
typical data
faulty data
Test data that is on the extremes of being acceptable to a validation rule is known as...
boundary data
diverse data
erroneous data
typical data
If a National Insurance number should be 2 letters followed by 6 digits followed by 1 letter between A and D, what would this test data example be?
TA451C53C
Erroneous
Normal
Boundary
Typical
What test data type would be 'normal' for someone's age to be entered in a membership form?
Real
Integer
Alphanumeric
Char
When using Conditional Test Data for selection within a program, MATCHING data will generate which kind of outcome?
TRUE outcome
FALSE outcome
An error in coding that occurs due to not following the rules of a programming language is known as...
a Logic error
a Syntax error
a Runtime error
a Path error
The process of detecting, locating and correcting errors is known as...
error finding
testing
error checking
debugging
Which error type can be seen in this line of Python code?
Runtime error
Logic error
Syntax error
Spelling error
The programmer wants to calculate the updated account balance by adding the monthly payments so far this year to the previous year's total. However, she forgot about BIDMAS. This is a...
Runtime error
Logic error
Syntax error
Maths error
Running this short program to print a name in a list will result in what type of error?
Runtime error
Logic error
Syntax error
List error
"When writing code, it is good practice to add (a) to explain what each part of the code does"
"The # (hash) symbol represents (a) in Python coding"
Gaps at the left hand side of blocks of Python code are known as...
margins
tabs
indents
line-ups
What symbol(s) can be used to temporarily disable a line of Python code?
/
//
.!
#
What are the correct reasons why a programmer might leave comments in their code. (choose TWO)
It is good programming practice
It helps other programmers understand what the code does
It stops the code from having errors
It allows functions to be accessed
Identify the type of error that prevents a program from being run.
Logic error
Runtime error
Syntax error
Execution error
Relational operators are used for validation, selection and iteration testing. What is the correct symbol for the 'less than or equal to' operator?
<=
>=
<>
>
