0% found this document useful (0 votes)
26 views7 pages

7 Section B 2 One Validation Verification Both Statement Validation Verification Both

Uploaded by

abhigyansinha37
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)
26 views7 pages

7 Section B 2 One Validation Verification Both Statement Validation Verification Both

Uploaded by

abhigyansinha37
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/ 7

7

Section B

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

Validation Verification Both


Statement
(ü) (ü) (ü)
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]

3 Name and describe the most appropriate programming data type for each of the examples of data
given. Each data type must be different.

Data: 37

Data type name ................................................................................................................................

Data type description .......................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Data: Cambridge2021

Data type name ................................................................................................................................

Data type description .......................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Data: 47.86

Data type name ................................................................................................................................

Data type description .......................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2021 0478/21/M/J/21 [Turn over


8

4 The pseudocode algorithm shown has been written by a teacher to enter marks for the students in
her class and then to apply some simple processing.

Count 0 ←
REPEAT
INPUT Score[Count]
IF Score[Count] >= 70
THEN
Grade[Count] "A" ←
ELSE
IF Score[Count] >= 60
THEN
Grade[Count] "B" ←
ELSE
IF Score[Count] >= 50
THEN
Grade[Count] "C" ←
ELSE
IF Score[Count] >= 40
THEN
Grade[Count] "D" ←
ELSE
IF Score[Count] >= 30
THEN
Grade[Count] "E" ←
ELSE
Grade[Count] "F" ←
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ←
Count + 1
UNTIL Count = 30

(a) Describe what happens in this algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/21/M/J/21


9

(b) Write the pseudocode to output the contents of the arrays Score[] and Grade[] along with
suitable messages.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) Describe how you could change the algorithm to allow teachers to use it with any size of
class.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/21/M/J/21 [Turn over


10

5 The flowchart represents an algorithm.

The algorithm will terminate if –1 is entered.

START

INPUT
Value

IS Yes
Value =
–1 ?
OUTPUT
"Reject: END
No
Abnormal"

IS
No Value >= 50
AND Value
<= 100 ?

Yes

Diff1 100 – Value

Diff2 Value – 50

IS
OUTPUT No Diff1 < 1 OR
"Accept: Normal" Diff2 < 1 ?

Yes

OUTPUT
"Accept:
Extreme"

© UCLES 2021 0478/21/M/J/21


11

(a) Complete the trace table for the input data:

50, 75, 99, 28, 82, 150, –1, 672, 80

Value Diff1 Diff2 OUTPUT

[4]

(b) Describe the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2021 0478/21/M/J/21 [Turn over


12

6 A library uses a database table, GENRE, to keep a record of the number of books it has in each
genre.

ID GenreName Total Available Loaned Overdue


ABI Autobiography 500 250 250 20
BIO Biography 650 400 250 0
EDU Education 20200 10000 10200 1250
FAN Fantasy 1575 500 1075 13
GFI General Fiction 35253 23520 11733 0
GNF General Non-Fiction 25200 12020 13180 0
HFI Historical Fiction 6300 3500 2800 0
HNF Historical Non-Fiction 8000 1523 6477 0
HUM Humour 13500 9580 3920 46
MYS Mystery 26000 13269 12731 0
PFI Political Fiction 23561 10523 13038 500
PNF Political Non-Fiction 1823 750 1073 23
REF Reference 374 374 0 0
ROM Romance 18269 16800 1469 0
SAT Satirical 23567 12500 11067 0
SCF Science Fiction 36025 25000 11025 0
SPO Sport 45720 32687 13033 3256
THR Thriller 86000 46859 39141 0

(a) State the reason ID could be used as a primary key in the table GENRE.

...................................................................................................................................................

............................................................................................................................................. [1]

(b) State the number of records in the table GENRE.

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2021 0478/21/M/J/21


13

(c) Complete the query-by-example grid to display any genres with overdue books. Only display
the ID, GenreName and Overdue fields in order of the number of books overdue from largest
to smallest.

Field:

Table:

Sort:

Show:

Criteria:

or:

[4]

© UCLES 2021 0478/21/M/J/21

You might also like