0% found this document useful (0 votes)
2 views

Edited – Algorithm Design Revision Assignment (5)

The document outlines an IGCSE Cambridge (CIE) Computer Science exam consisting of 18 questions across three difficulty levels: easy, medium, and hard, totaling 68 marks. It covers topics such as validation and verification checks, suitable test data, and algorithms, providing examples and requiring students to demonstrate their understanding through various question formats. Additionally, it includes trace tables and pseudocode for students to complete as part of the exam assessment.

Uploaded by

yegorfurs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Edited – Algorithm Design Revision Assignment (5)

The document outlines an IGCSE Cambridge (CIE) Computer Science exam consisting of 18 questions across three difficulty levels: easy, medium, and hard, totaling 68 marks. It covers topics such as validation and verification checks, suitable test data, and algorithms, providing examples and requiring students to demonstrate their understanding through various question formats. Additionally, it includes trace tables and pseudocode for students to complete as part of the exam assessment.

Uploaded by

yegorfurs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

IGCSE Cambridge (CIE) Computer Science 1 hour 18 questions

Exam Questions

Validation &
Verification
Validation & Verification / Suitable Test Data / Trace Tables

Easy (3 questions) /6 Scan here to return to the course


or visit savemyexams.com
Medium (8 questions) /31

Hard (7 questions) /31

Total Marks /68

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 1
Easy Questions
1 A range check is used to check that a value input is above 10 and below 20.

Tick (✓) one box to show which value would be accepted.

A. 10
B. 15
C. 20
D. 30
(1 mark)

2 Verification checks can be made on input data.

Tick (✓) one box to show which check is a verification check on input data.

A. checksum
B. double entry check
C. echo check
D. parity check
(1 mark)

3 Tick (✓) one box in each row to identify if the statement is about validation,
verification or both.

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 2
Statement Validation Verification Both
(✓) (✓) (✓)

Entering the data twice to check if both entries


are
the same.

Automatically checking that only numeric data has


been entered.

Checking data entered into a computer system


before it is stored or processed.

Visually checking that no errors have been


introduced during data entry.

(4 marks)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 3
Medium Questions
1 Describe the purpose of validation and verification checks during data entry.

Include an example for each.

Validation ensures that the data entered is reasonable and follows predefined rules, helping to prevent errors
before they are processed. However, it does not guarantee accuracy.
Example: A form may require a phone number to be exactly 10 digits long. If a user enters only 9 digits, the
system will not accept the input.
• Verification ensures that the data entered matches the original source and is accurate. It helps detect
errors introduced during data input.
Example: A bank asks a customer to re-enter their email address to confirm accuracy when signing up for
online banking

(4 marks)

2 A programmer has written an algorithm to check that prices are less than $10.00

These values are used as test data:

10.00 9.99 ten

State why each value was chosen as test data.

10.00 .........................................................................

9.99 ............................................................................

ten ...............................................................................

(3 marks)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 4
3 A program checks if the weight of a baby is at least 2 kilograms.

Give, with reasons, two different values of test data that could be used for the baby’s
weight. Each reason must be different.

(4 marks)

4 Give one piece of normal test data and one piece of erroneous test data that could be
used to validate the input of an email address.

State the reason for your choice in each case.

[email protected]

exampleeemail.com

(4 marks)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 5
5 An algorithm allows a user to input their password and checks that there are at least
eight characters in the password. Then, the user is asked to re-input the password to
check that both inputs are the same. The user is allowed three attempts at inputting a
password of the correct length and a matching pair of passwords. The pre-defined
function LEN(X) returns the number of characters in the string, X

01 Attempt ← 0
02 REPEAT
03 PassCheck ← TRUE
04 OUTPUT "Please enter your password "
05 INPUT Password
06 IF LEN(Password) < 8
07 THEN
08 PassCheck ← TRUE
09 ELSE
10 OUTPUT "Please re-enter your password "
11 INPUT Password2
12 IF Password <> Password
13 THEN
14 PassCheck ← FALSE
15 ENDIF
16 ENDIF
17 Attempt ← Attempt + 1
18 UNTIL PassCheck OR Attempt <> 3
19 IF PassCheck
20 THEN
21 OUTPUT "Password success"
22 ELSE
23 OUTPUT "Password fail"
24 ENDIF

Give two sets of test data for this algorithm and a reason for choosing each set.

Each set of test data and its reason must be different.

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 6
(4 marks)

6 Describe what is meant by data validation

(2 marks)

7 A validation check is used to make sure that any value that is input is an integer between
30 and 200 inclusive.

Give one example of each type of test data to check that the validation check is
working as intended. Each example of test data must be different.

Give a reason for each of your choices of test data.

Normal test data

Abnormal test data

Extreme test data

(6 marks)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 7
8 (a) A program needs to make sure the value input for a measurement meets the following
rules:

the value is a positive number

a value is always input

the value is less than 1000

Describe the validation checks that the programmer would need to use.

(3 marks)

(b) The program needs editing to include a double entry check for the value input

State why this check needs to be included.

(1 mark)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 8
Hard Questions
1 This flowchart represents an algorithm.

The array Name[1:4] used in the flowchart contains the following data:

Name[1] Name[2] Name[3] Name[4]

Jamal Amir Eve Tara

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 9
Complete the trace table using the data given in the array

Flag Count Name[1] Name[2] Name[3] Name[4] Temp

Jamal Amir Eve Tara

(5 marks)

2 This flowchart inputs the weight of items, in kilograms, to be loaded on a trailer. Any item

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 10
over 25 kilograms is rejected. The trailer can take up to 100 kilograms.

Complete the trace table for the input data:

13, 17, 26, 25, 5, 10, 15, 35, 20, 15

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 11
Weight Reject TotalWeight OUTPUT

(5 marks)

3 The pseudocode represents an algorithm.

The pre-defined function DIV gives the value of the result of integer division. For example,
Y = 9 DIV 4 gives the value Y = 2

The pre-defined function MOD gives the value of the remainder of integer division. For
example, R = 9 MOD 4 gives the value R = 1

First ← 0
Last ← 0
INPUT Limit
FOR Counter ← 1 TO Limit
INPUT Value
IF Value >= 100
THEN
IF Value < 1000
THEN

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 12
First ← Value DIV 100
Last ← Value MOD 10
IF First = Last
THEN
OUTPUT Value
ENDIF
ENDIF
ENDIF
NEXT Counter

Complete the trace table for the algorithm using this input data:

8, 66, 606, 6226, 8448, 642, 747, 77, 121

Counter Value First Last Limit OUTPUT

(1 mark)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 13
4 An algorithm allows a user to input their password and checks that there are at least
eight characters in the password. Then, the user is asked to re-input the password to
check that both inputs are the same. The user is allowed three attempts at inputting a
password of the correct length and a matching pair of passwords. The pre-defined
function LEN(X) returns the number of characters in the string, X

01 Attempt ← 0
02 REPEAT
03 PassCheck ← TRUE
04 OUTPUT "Please enter your password "
05 INPUT Password
06 IF LEN(Password) < 8
07 THEN
08 PassCheck ← TRUE
09 ELSE
10 OUTPUT "Please re-enter your password "
11 INPUT Password2
12 IF Password <> Password
13 THEN
14 PassCheck ← FALSE
15 ENDIF
16 ENDIF
17 Attempt ← Attempt + 1
18 UNTIL PassCheck OR Attempt <> 3
19 IF PassCheck
20 THEN
21 OUTPUT "Password success"
22 ELSE
23 OUTPUT "Password fail"
24 ENDIF

The algorithm includes two types of check on the data input.

Identify and describe each type of check.

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 14
(4 marks)

5 This algorithm checks the temperature of hot food being served to customers.

Complete the trace table for the algorithm using this input data:

75, 78, 84, 87, 91, 80, 75, 70, 65, 62, –1, 20

Counter Hot Cold Serve Temp Error OUTPUT

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 15
(7 marks)

6 The flowchart represents an algorithm.

The table represents the two-dimensional (2D) array Word[] which stores the first half of
the phonetic alphabet used for radio transmission. For example, Word[10,1] is ‘J’.

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 16
Index 1 2

1 A Alpha

2 B Bravo

3 C Charlie

4 D Delta

5 E Echo

6 F Foxtrot

7 G Golf

8 H Hotel

9 I India

10 J Juliet

11 K Kilo

12 L Lima

13 M Mike

Complete the trace table for the algorithm by using the input data: F, Y, D, N

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 17
Pointer Letter Choice OUTPUT

(4 marks)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 18
7 This flowchart represents an algorithm.

The array X[1:5] used in the flowchart contains this data:

X[1] X[2] X[3] X[4] X[5]

10 1 5 7 11

Complete the trace table by using the data given in the array.

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 19
F C X[1] X[2] X[3] X[4] X[5] T

10 1 5 7 11

(5 marks)

© 2024 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 20

You might also like