wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Maintainability

Total questions: 78

Worksheet time: 45mins

Name
Class
Date
1.

A program is written that will accept an input and then print out the next four hexadecimal numbers in this list:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

If it gets to the end of the list, it goes back to the start.


If the user types in the number 8, what will be the next 4 numbers

a)

9,10,11,12

b)

9,A,B,C,D

c)

A,B,C,D,E,F

d)

9,A,B,C

2.

A program is written that will accept an input and then print out the next four hexadecimal numbers in this list:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

If it gets to the end of the list, it goes back to the start.


The program is tested using the number 4 as an input. What is the reason for this test.

a)

To test if the program prints out the next 4 numbers

b)

To check to see if the program loops back to the beginning of the list

c)

To check to see if the input is valid

d)

Tests to see if it works ok

3.

A program is written that will accept an input and then print out the next four hexadecimal numbers in this list:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

If it gets to the end of the list, it goes back to the start.


The program is tested using the number D as an input. What is the reason for this test.

a)

To test if the program prints out the next 4 numbers

b)

To check to see if the program loops back to the beginning of the list

c)

To check to see if the input is valid

d)

Tests to see if it works ok

4.

A program is written that will accept an input and then print out the next four hexadecimal numbers in this list:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

If it gets to the end of the list, it goes back to the start.


The program is tested using the number Z as an input. What is the reason for this test.

a)

To test if the program prints out the next 4 numbers

b)

To check to see if the program loops back to the beginning of the list

c)

To check to see if the input is valid

d)

Tests to see if it works ok

5.

What term is used to describe data passed into/out of a program?

a)

Variable

b)

Loop

c)

Constant

d)

Parameter

6.
What is a procedure?
a)
A small section of code within a program which performs a task
b)
Code which produces a calculated result
7.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
8.
How many times will Boo print?
a)
none
b)
4
c)
5
d)
1
9.
What will print?
a)
1 2
b)
1
c)
3
d)
5
10.

What will be the output of this program if the user enters "Han" and then "Solo"?

a)

An error

b)

Nothing

c)

first surname

d)

Han Solo

11.
How do you correctly call this function
a)
def(1)
b)
x=square( )
c)
defSquare(4)
d)
x=square(5)
12.

What is the difference between a function and a procedure?

a)

A function returns a value, a procedure does not.

b)

A function accepts parameters, a procedure does not

c)

A procedure returns a value, a function does not.

d)

A procedure accepts parameters, a function does not

13.

Select ALL the advantages of using SUBROUTINES when writing a program.

a)

Problems can be broken down into smaller parts (Decomposition)

b)

Subroutines can be tested independently

c)

The same subroutines can be used in different programs

d)

The subroutines can be used multiple times within a program

e)

Makes the code longer

14.

Select ALL the advantages of using SUBROUTINES when writing a program.

a)

Makes the code shorter

b)

Easier to maintain the code

c)

Easier to debug

d)

Work can be split easily between members of the team

e)

Adds complexity

15.
A program won't run if there is a logic error.
a)
False
b)
True
16.
Which statement best describes logic errors?
a)
An error in a program that causes it to produce incorrect ouputs but not a crash.
b)
An error in a program that causes it to crash.
c)
An error in the program caused by mis-spelt instructions.
d)
An error in a program caused by hardware failure.
17.

What type of error would result from you attempting to find the area of a circle, but you end up using the wrong equation.

a)

Logic Error

b)

Semantics Error

c)

Syntax Error

18.

Which of the following is a syntax error?

a)

Attempting to divide by 0

b)

Forgetting a colon at the end of a statement where one is required.

c)

Forgetting to divide by 100 when printing a percentage amount.

19.

Examples of this type of error would be missing a comma or a quotation mark, or misspelling a word.

a)

Logic Error

b)

Semantics Error

c)

Syntax Error

20.
Which line has a syntax error?
a)
1
b)
2
c)
3
d)
4
21.
Which line has a syntax error?
a)
5
b)
2
c)
3
d)
4
22.
Which line has a syntax error?
a)
1
b)
2
c)
3
d)
4
23.
Which line has a syntax error?
a)
1
b)
2
c)
6
d)
8
24.
Which line has a syntax error?
a)
1
b)
3
c)
6
d)
8
25.
Which line has a syntax error?
a)
1
b)
3
c)
5
d)
6
26.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

27.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

28.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

29.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

30.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

31.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

32.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

33.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

34.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

35.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

36.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

37.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

38.

What does this sentences describe "testing which is done while program is being written"

a)

playing

b)

iterative testing

c)

final/terminal testing

d)

professional testing

39.

Is this a logical or syntax error?

a)

Logical error

b)

Syntax error

40.
What is this operator? +
a)
addition
b)
subtraction
c)
multiplication
d)
division
41.
What is this operator? -
a)
addition
b)
subtraction
c)
multilplication
d)
division
42.
What is this operator? *
a)
addition
b)

subtraction

c)
multiplication
d)
division
43.
What is this operator? /
a)
addition
b)
subtraction
c)
remainder
d)
division - only the whole number
44.
What is this operator? =
a)
Equal to
b)
Used in a calculation for equals
c)
and
d)
or
45.
What is this operator? >
a)
Greater than
b)
Less than or equal to
c)
Less than
d)
Greater than or equal to
46.
What is this operator? <
a)
Greater than
b)
Less than or equal to
c)
Less than
d)
Greater than or equal to
47.
What is this operator? >=
a)
Greater than
b)
Less than or equal to
c)
Less than
d)
Greater than or equal to
48.
What is this operator? <=
a)
Greater than
b)

Less than or equal to

c)
Less than
d)
Greater than or equal to
49.
What is this operator? %
a)
Concatenation
b)
Remainder or mod
c)
Division - only the whole number
d)
Escape character
50.
What is this operator? ==
a)
Equal to
b)
Used in a calculation for equals
c)
and
d)
or
51.
What is this operator? !
a)
and
b)
or
c)
not
d)
equal to
52.
What is this operator? ||
a)
and
b)
or
c)
Remainder or mod
d)
Division
53.
What is this operator? &&
a)
and
b)
or
c)
Remainder or mod
d)
Multiplication
54.
What operators is this !=
a)
not equal to 
b)
equal to
c)
Greater than 
d)
Greater than or equal to 
55.
What data type would this be "Hello Word!"
a)
Data
b)
String
c)
Numeric
d)
Float
56.
What data type would hold numbers with a decimal point
a)
Data
b)
String
c)
Numeric
d)
Float
57.
What data type would this be "555.78"
a)
Data
b)
String
c)
Numeric
d)
Float
58.

What is meant by a syntax error?

a)

An error in the grammar of the program.

b)

A spelling error

c)

List index out of range

d)

Index error

59.
Range validation ensures input data falls between specified values.
a)
True
b)
False
60.
Type validation ensures that input data is limited to only certain data types.
a)
True
b)
False
61.
Data is validated, users are authenticated.
a)
True
b)
False
62.
Inputting invalid data can cause errors in a system.
a)
True
b)
False
63.
Defensive design is about anticipating potential problems at the planning stage.
a)
True
b)
False
64.

Which of these is not a method for ensuring a program is robust?

a)

Keeping passwords safe

b)

Data Validation

c)

Authentication

d)

Data Sanitisation

65.

What is data validation?

a)

Checking that the data entered is wrong

b)

Checking that the data entered is correct

c)

Checking that the data entered is sensible or reasonable

66.

What does a range check do?

a)

Checks data across a range of numbers

b)

Checks the data is within an acceptable range

c)

Where three types of data are used

d)

Checks that the data is in the correct format

67.

Defensive design of programs includes input sanitization. What does input sanitization mean?

a)

Cleaning up input data and removing unwanted data.

b)

Checking if the input data is valid (follows given criteria)

c)

Checking if the data has been entered correctly e.g. double entry

d)

Checking only authorized users can gain access to the system

e)

Creating maintainable code by adding comments and explanations

68.

Defensive design of programs includes Validation. What does input sanitization mean?

a)

Cleaning up input data and removing unwanted data.

b)

Checking if the input data is valid (follows given criteria)

c)

Checking if the data has been entered correctly e.g. double entry

d)

Checking only authorized users can gain access to the system

e)

Creating maintainable code by adding comments and explanations

69.

Defensive design of programs includes Authentication. What does Authentication mean?

a)

Cleaning up input data and removing unwanted data.

b)

Checking if the input data is valid (follows given criteria)

c)

Checking if the data has been entered correctly e.g. double entry

d)

Checking only authorized users can gain access to the system

e)

Creating maintainable code by adding comments and explanations

70.

Defensive design of programs includes Maintainability. What does Maintainability mean?

a)

Cleaning up input data and removing unwanted data.

b)

Checking if the input data is valid (follows given criteria)

c)

Checking if the data has been entered correctly e.g. double entry

d)

Checking only authorized users can gain access to the system

e)

Creating maintainable code by adding comments and explanations

71.

Define ABSTRACTION

a)

Breaking a task into smaller tasks.

b)

Drawing a map to show how to reach a destination.

c)

Creating step by step instructions.

d)

Focusing on what is important and ignoring what is unnecessary.

72.
Picking out the important bits of information from the problem, ignoring the specific details that don't matter.
a)
Decomposition
b)
Abstraction
c)
Programming
d)
Algorithmic Thinking
73.
Breaking a complex problem down into smaller problems and solving each one individually.
a)
Decomposition
b)
Abstraction
c)
Programming
d)
Algorithmic Thinking
74.
What is an algorithm?
a)
A sequence of instructions on how to solve a problem.
b)
The breaking down of a problem into smaller parts.
c)
Focusing on important parts and ignoring the irrelevant details
d)
The recipe for a cake
75.

Abstraction is:

a)

adding to a problem

b)

filtering out all irrelevant characteristics and unnecessary details

c)

finding characteristics

d)

looking for similarities

76.

Click all that applies. Abstraction:

a)

is a problem solving tool

b)

removes unimportant information

c)

adds important information

d)

simplifies a situation

e)

focuses on what is important

77.

What is decomposition?

a)

Adding detail to make a problem more complex

b)

Breaking down a complex problem or system into smaller, more manageable parts

c)

When you ignore the unnecessary detail in a problem

78.

What is Abstraction?

a)

The use of computers to solve problems

b)

Breaking down a large problem into smaller sub-problems

c)

Representing 'real world' problems in a computer using variables and symbols and removing unnecessary elements from the problem

d)

Identifying the steps involved in solving a problem