wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AQA 8525 GCSE CS 3.2.10 Subroutines & 3.2.11 Robust & Secure

Total questions: 50

Worksheet time: 50mins

Name
Class
Date
1.

A subroutine is a block of code that can be executed by (a)   it from the program?

2.

When a subroutine has finished executing its code...

a)

the program will continue with the next line of programming code after the line that goes to the subroutine

b)

the program will end even if there are more lines of code after the subroutine was used

c)

the program will return to the start regardless of wherever it reached when the subroutine was referenced

d)

the program will run any remaining subroutines, ignoring any other code remaining in the program

3.

procedures and functions are both types of...

a)

subroutines

b)

selection

c)

iteration

d)

sequence

4.

Compared to functions, Procedures do not return a...

a)

value

b)

variable

c)

virus

d)

valuation

5.

Functions always return a...

a)

value

b)

vector

c)

version

d)

valuation

6.

Here is a procedure, what does it do?

a)

Displays a company's name and address on the screen

b)

Saves a company's name and address in a file

c)

Returns a company's name and address as a value to the program

d)

Slices a company's name and address

7.

In this simple function, what will be returned if the user enters a=24, b=8

a)

16

b)

3

c)

32

d)

192

8.

On which line of this simple function, is there an error?

a)

1

b)

2

c)

4

d)

5

9.

Subroutines defined by the user are called...

a)

custom-made subroutines

b)

tailored subroutines

c)

manmade subroutines

d)

user-selected subroutines

10.

A subroutine is like a (a)   - what happens inside is not seen by the rest of the program.

11.

To use different values in subroutines, data can be passed into the subroutine using...

a)

arguments

b)

parameters

c)

variables

d)

constants

12.

In pseudo-code, the value to be passed back to the main program from a function must be declared using...

a)

PASSBACK

b)

CONTINUE

c)

RETURN

d)

EXIT

13.

A function is applied by assigning its result to a variable or by using it as part of an...

a)

formula

b)

constant

c)

value

d)

expression

14.

"Functions can be particularly useful when they include several lines of code represented in a single code word"

a)

True

b)

False

15.

A slicing function would take as its parameters...

a)

name of the string, start and end characters of the slice

b)

start and end characters of the slice

c)

name of the string, end character of the slice

d)

name of the string, number of characters in the slice

16.

Any variables declared within the main part of the program are known as...

a)

pseudo variables

b)

local variables

c)

global variables

d)

whole variables

17.

Global variables are available to...

a)

the main program only

b)

the subroutines only

c)

the pseudo-code only

d)

every part of the program

18.

"Global variables waste memory"

a)

True

b)

False

19.

"When a subroutine is executed, all local variables are added to memory with their previous values"

a)

True

b)

False

20.

A subroutine's name is known as its...

a)

call-name

b)

identifier

c)

sub-name

d)

return

21.

Modularised programming refers to creating code according to which aspect of computational thinking

a)

decomposition

b)

abstraction

c)

arithmetic

d)

algorithms

22.

With subroutines, the detail of each subroutine is removed from the main program. This computational thinking aspect is known as...

a)

decomposition

b)

slicing

c)

abstraction

d)

generalisation

23.

Validation means...

a)

ensuring the data is true

b)

ensuring the data is accurate

c)

ensuring the data is correct

d)

ensuring the data meets allowed criteria

24.

An error message will usually inform the user if the input data is not acceptable to the system

a)

True

b)

False

25.

A presence check ensures that...

a)

data is of the required length

b)

data has been entered in the field

c)

data is within a number range

d)

data is of the correct data type

26.

Ensuring data entered matches a particular pattern is a...

a)

Pattern check

b)

Range check

c)

Format check

d)

Type check

27.

Which type of validation checks to see if data entered exists in a list?

a)

Lookup check

b)

Format check

c)

Type check

d)

Presence check

28.

Validation ensures that valid data is accepted and (a)   data is rejected.

29.

The process of checking that a user is who they say they are is known as...

a)

validation

b)

authentication

c)

testing

d)

accuracy

30.

User names and passwords for multi-user authentication could be stored in...

a)

a two-dimensional array

b)

a multi-dictionary

c)

a list of lists

d)

a simple list

31.

Trying to find if there are, or there are not errors within a software solution is known as...

a)

authentication

b)

validation

c)

generalisation

d)

testing

32.

Testing is carried out on code for what reasons? (choose two)

a)

checking it performs as expected

b)

checking it meets requirements

c)

checking it runs as fast as expected

d)

checking it's compiled into machine code

33.

Test data that is typically acceptable to a validation rule is known as...

a)

diverse data

b)

boundary data

c)

normal data

d)

erroneous data

34.

Test data that would be rejected by a program is known as...

a)

erroneous data

b)

normal data

c)

typical data

d)

faulty data

35.

Test data that is on the extremes of being acceptable to a validation rule is known as...

a)

boundary data

b)

diverse data

c)

erroneous data

d)

typical data

36.

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

a)

Erroneous

b)

Normal

c)

Boundary

d)

Typical

37.

What test data type would be 'normal' for someone's age to be entered in a membership form?

a)

Real

b)

Integer

c)

Alphanumeric

d)

Char

38.

When using Conditional Test Data for selection within a program, MATCHING data will generate which kind of outcome?

a)

TRUE outcome

b)

FALSE outcome

39.

An error in coding that occurs due to not following the rules of a programming language is known as...

a)

a Logic error

b)

a Syntax error

c)

a Runtime error

d)

a Path error

40.

The process of detecting, locating and correcting errors is known as...

a)

error finding

b)

testing

c)

error checking

d)

debugging

41.

Which error type can be seen in this line of Python code?

a)

Runtime error

b)

Logic error

c)

Syntax error

d)

Spelling error

42.

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...

a)

Runtime error

b)

Logic error

c)

Syntax error

d)

Maths error

43.

Running this short program to print a name in a list will result in what type of error?

a)

Runtime error

b)

Logic error

c)

Syntax error

d)

List error

44.

"When writing code, it is good practice to add (a)   to explain what each part of the code does"

45.

"The # (hash) symbol represents (a)   in Python coding"

46.

Gaps at the left hand side of blocks of Python code are known as...

a)

margins

b)

tabs

c)

indents

d)

line-ups

47.

What symbol(s) can be used to temporarily disable a line of Python code?

a)

/

b)

//

c)

.!

d)

#

48.

What are the correct reasons why a programmer might leave comments in their code. (choose TWO)

a)

It is good programming practice

b)

It helps other programmers understand what the code does

c)

It stops the code from having errors

d)

It allows functions to be accessed

49.

Identify the type of error that prevents a program from being run.

a)

Logic error

b)

Runtime error

c)

Syntax error

d)

Execution error

50.

Relational operators are used for validation, selection and iteration testing. What is the correct symbol for the 'less than or equal to' operator?

a)

<=

b)

>=

c)

<>

d)

>