0% found this document useful (0 votes)
27 views5 pages

OUTPUT "Please Enter The Number of Seats You Want To Book " INPUT Seats

Uploaded by

anish
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)
27 views5 pages

OUTPUT "Please Enter The Number of Seats You Want To Book " INPUT Seats

Uploaded by

anish
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/ 5

4

4 A programmer is writing a data entry program for booking theatre seats.


The programmer needs the program to accept only whole numbers that are greater than or equal
to one and less than or equal to six.

(a) Give the names of two validation checks that are required for this program.

1 ................................................................................................................................................

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

(b) Complete this pseudocode to perform your two validation checks, using your answers given
in (a):

OUTPUT "Please enter the number of seats you want to book "

INPUT Seats

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

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

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

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

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

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

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

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

...................................................................................................................................................
[5]

(c) Give one item of test data to use when testing this program.
State the reason for your choice of test data.

Test data ...................................................................................................................................

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

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

© UCLES 2023 0478/23/O/N/23


6

5 An algorithm has been written in pseudocode to check if a new password is in a list of previously
used passwords OldList[]
If the password is not found, the new password will be stored at the end of the list to replace
"XXXX" already stored there.

01 OUTPUT "Enter your new password "


02 INPUT NewPassword
03 Posn 1
04 Found FALSE
05 REPEAT
06 IF Password = OldList[Posn]
07 THEN
08 Found TRUE
09 ELSE Posn Posn + 1
10 ENDIF
11 UNTIL Found AND OldList[Posn] = "XXXX"
12 IF Found
13 THEN
14 OUTPUT "Password has been used before"
15 ELSE
16 INPUT "New password accepted"
17 OldList[Posn] NewPassword
18 ENDIF

(a) Identify the three errors in the pseudocode and suggest corrections.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

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

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

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

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

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

© UCLES 2023 0478/23/O/N/23


7

(b) Complete this flowchart for the corrected algorithm:

START

STOP

[6]

© UCLES 2023 0478/23/O/N/23 [Turn over


10

8 This is an algorithm to find if a batch of parts has been manufactured successfully.

START

Accept 0
Reject 0

INPUT PartOK

No
IS PartOK Reject Reject + 1
= 'Y'?
Yes

Accept Accept + 1

No IS Accept
= 10 ?

Yes

Yes
IS Reject Error Reject/Accept * 100
> 1?

No
OUTPUT
"Too many rejected ",
OUTPUT Error, "% error"
"Success"

STOP

© UCLES 2023 0478/23/O/N/23


11

(a) Complete the trace table using this data:


Y, Y, Y, N, Y, Y, Y, Y, N, Y, Y, Y, Y

Accept Reject PartOK Error OUTPUT

[5]

(b) Describe how the algorithm should be changed to accept ‘Y’ or ‘y’ for a successfully
manufactured part.

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

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

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

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

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

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

© UCLES 2023 0478/23/O/N/23 [Turn over

You might also like