Validation and Testing (CIE IGCSE Computer Science)

Topic Questions

1
Sme Calculator
4 marks

Describe the purpose of validation and verification checks during data entry.

Include an example for each.

Validation check ......................................................................................................

Verification check ....................................................................................................

[4]

Did this page help you?

2
Sme Calculator
3 marks

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]

Did this page help you?

3
Sme Calculator
2 marks

TASK 1 – Set up arrays
Set-up one dimensional arrays to store:

• Student names
• Student marks for Test 1, Test 2 and Test 3

o Test 1 is out of 20 marks
o Test 2 is out of 25 marks
o Test 3 is out of 35 marks

• Total score for each student

Input and store the names for 30 students. You may assume that the students’ names are unique.
Input and store the students’ marks for Test 1, Test 2 and Test 3. All the marks must be validated on entry and any invalid marks rejected

Show two different sets of student data that you could use to check the validation used in Task 1. Explain why you chose each data set.

   Set 1 .........................................

   Reason for choice ......................................

   Set 2 .....................................................

   Reason for choice .........................................

[2]

Did this page help you?

4a
Sme Calculator
2 marks

Jatinder uses Internet banking.
This pseudocode checks her PIN.

c ← 0
INPUT PIN
x ← PIN
REPEAT
   x ← x/10
   c ← c + 1
UNTIL x < 1
IF c <> 5
   THEN
       PRINT “error in PIN entered”
   ELSE
       PRINT “PIN OK”
ENDIF

a)
What value of c and what message would be output if the following PINs were entered?
5 1 0 2 0   Value of c: ........................................................
                   Message: ..........................................................
5 1 2 0      Value of c: .........................................................
                  Message: ............................................................
[2]
4b
Sme Calculator
1 mark
b)
What type of validation check is being carried out here?
[1]

Did this page help you?

5
Sme Calculator
2 marks

Describe, with examples, two sets of test data you would use to test your algorithm.

1 ..................................................
2 ...................................................

[2]

Did this page help you?

6
Sme Calculator
3 marks

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

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.
     

[3]

Did this page help you?