Past-paper question · 2014 October-November · Paper 23 · Q4(c)(i)

Question 4(c)(i) 2014 · October-November · Paper 23 · 20 marks

Question 4

Part (c)

(i)

Question 4

Swimming \\\\\\

She designs two procedures OutputTallyChart and OutputTally.

OutputTallyChart outputs the first two columns of the tally chart and then calls OutputTally to output the correct number of bars (\).

Complete the pseudocode:

PROCEDURE OutputTallyChart OUTPUT "1 Cricket "

OutputTally(.......................................) OUTPUT "2 Football "

OutputTally(.......................................) OUTPUT "3 Tennis "

OutputTally(.......................................) OUTPUT "4 Swimming "

OutputTally(.......................................) ENDPROCEDURE

PROCEDURE OutputTally(SportCount : INTEGER)

IF ....................................... // check there are bars // to output THEN ....................................... OUTPUT '\' ....................................... ENDIF

....................................... ENDPROCEDURE

[6]

Question 5

Part (d)

Rema wants to test each module before she tests the whole program.

The first module she is going to test is the OutputTally procedure using different parameter values.

Give three different types of test data with an example of each.

Justify your choices.

Type of test data Example test data Justification

[9]

Part (e)

(i)

All programs should be maintainable. Rema has followed good practice in writing her

pseudocode. She used some features of maintainable programs.

List three such features.

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

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

2 .........................................................................................................................................

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

3 .........................................................................................................................................

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

(ii)

Give one further feature that Rema has not used in her solution so far.

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

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

Question 6

2 Ali sets up user IDs and passwords for his program.

When the user types in their user ID, the program looks up the stored password for this user ID.

The stored password is the encrypted version of the user’s password. Ali is going to write the program for Ahmed. The size of one floor tile is 30 cm × 30 cm. Ali knows that the following calculations are required:

TilesForWidth ← RoomWidth DIV 30 TilesForLength ← RoomLength DIV 30 TilesRequired ← TilesForWidth * TilesForLength

(i)

If the room width measures 100 cm, give the value stored in TilesForWidth.

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

If the room measurements are not exact multiples of 30 cm, the number of tiles must be rounded up so that Ahmed has enough tiles.

Ali knows that he can use the MOD operator to test for this.

Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9691_w14_ms_23.pdf →

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9691_w14_qp_23.pdf

Keep practising this topic