Past-paper question · 2018 May-June · Paper 23 · Q2(a)

Question 2(a) 2018 · May-June · Paper 23 · 2 marks

Original past-paper question for 2(A)
Original past-paper question for 2(A)
Reveal official mark-scheme answer Official mark-scheme answer for 2(A)

Official answer for Question 2

Part (a)

✓
Comments:

Question 2

✓
Explain the functionality of the code // Easier for other people to
✓
understand // Easier to maintain / debug / modify
✓
Indentation:
✓
Easier to identify structure / blocks // identify blocks of code

Mark scheme 9608_s18_ms_23.pdf →

Show text version of question

Question 2

Part (a)

Question 2

The following is a function design in pseudocode.

Line numbers are given for reference only.

01 FUNCTION GradeCalc(Mark : ARRAY[] OF INTEGER) RETURNS INTEGER 02 03 DECLARE DGradeCount : INTEGER 04 DECLARE n : INTEGER 05 DECLARE Grade : STRING 06 DECLARE ThisMark : INTEGER 07 08 DGradeCount 0 // initialise variables 09 n 1 10 ThisMark 1 11 REPEAT 12 ThisMark Mark[n] // get next mark from Mark array

Question 13

14 IF ThisMark > 74 15 THEN 16 Grade "Distinction" 17 DGradeCount DGradeCount + 1 // one more Distinction 18 ELSE 19 IF ThisMark > 59 20 THEN 21 Grade "Merit" 22 ELSE 23 IF ThisMark > 39 24 THEN 25 Grade "Pass" 26 ELSE 27 Grade "Fail" 28 ENDIF 29 ENDIF 30 ENDIF

Question 31

32 OUTPUT "Grade for Student " & n & " is " & Grade

Question 33

34 n n + 1 35 UNTIL n = 101 // no more elements in the array

Question 36

37 RETURN Grade // return the number of Distinction grades

Question 38

39 ENDFUNCTION

Question 40

41 DECLARE Mark : ARRAY[1:100] OF INTEGER 42 DECLARE DistinctionGrades : INTEGER

Question 43

44 CALL GetMarks(Mark[]) // fill the array with student marks 45 DistinctionGrades GradeCalc(Mark[])

Question 5

Part (a)

This pseudocode includes features that are examples of good practice.

Explain why it is useful to include the two following features.

Comments ................................................................................................................................

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

Indentation ................................................................................................................................

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

[2]
Topic relevance

Why this question appears here

82% 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 9608_s18_qp_23.pdf

Keep practising this topic