REVISION PAPER
Name:
1. Draw a line to link each term with its most appropriate description.
Term Description
An individual section of code that can be used by
Subroutine 1 a
other programs
Library routine 2 b A short section of code within a program
A commonly used function that is available to a
Top-down design 3 c
programmer
A design process where an overall task is broken
Decomposition 4 d
down into smaller tasks
The process of breaking down large tasks into
Module 5 e
smaller tasks
Shows the task that have been broken down and
Structure diagram 6 f
how they relate to each other
Used to trace the values of variables through the
Pseudocode 7 g
execution of a program
Flowchart 8 h Text-based method of describing an algorithm
A way of representing the structure and flow of an
Dry run 9 i
algorithm
Paper-based run through of an algorithm or a
Trace table 10 j
program
[10]
2. Identify what type of error is given below. SYNTAX ERROR or LOGIC ERROR
________________________ a The line contains a spelling error
________________________ b Assigning wrong data type to a variable
________________________ c The line is incomplete
________________________ d Using unconditional loop
________________________ e The elements are in the wrong order
________________________ f Using the same variable name for different purposes
[6]
3. Match the following validation checks in the box to its correct description and give example to each validation
check.
Range check Presence check Type check
Lookup Length check Format check
a. Specifies that data entered must conform to a specific format
______________________
Example:
b. Specifies that data entered must be numerical data in a range
______________________
Example:
c. Specifies that data entered must be a certain number of characters long
______________________
Example:
d. Specifies that only a certain type of data can be entered
______________________
Example:
e. Makes sure that a field must have data entered in it
______________________
Example:
f. Providing the user with a drop-down list to select data.
______________________
Example:
[12]
4. Explain following ways to verify a data.
a. Double entry ________________________________________________________________________
b. Twin entry ________________________________________________________________________
c. Proofreading ________________________________________________________________________
[3]
5. Consider the ISBNs below.
a. Is the check digit in the ISBN-13 number 9781 1075 1869 2 correct? Show your solution below.
[4]
b. Is the check digit in the ISBN-13 number 9782 0537 0300 8 correct? Show your solution below.
[4]
6. This pseudocode checks the grades that are input and outputs the average of all grades.
total ← 0
count ← 0
WHILE count < 3:
INPUT (“Enter your grade”)
GET grade
total = total + grade
count = count + 1
END WHILE
average = total / count
PRINT (Average = “, average)
Use these data and complete the trace table to dry-run the algorithm.
Grades : 80 , 90 , 60 , 50 , 90 , 65 , 80 , 100 , 50
total count grade average
[4]