TK Study

Past questions › sdd2024-q23

2024 6 marks Extended response The Software Engineering Project (Year 12) Desk check and debugging an algorithm

NESA 2024 HSC Software Design and Development (OLD syllabus) - Section II Question 23, with NESA Marking Guidelines

The following algorithm was written to find the average mark and the maximum mark in a school assessment. The assessment marks are stored in a sequential file called MarksData. 10 | BEGIN Analysis 20 | Max = 100 30 | Num_Students = 0 40 | Open MarksData for input 50 | Read Mark from MarksData 60 | WHILE NOT EOF 70 | IF Mark > Max THEN 80 | Max = Mark 90 | ENDIF 100 | Add 1 to Num_Students 110 | Average = Mark/Num_Students 120 | Read Mark from MarksData 130 | END WHILE 140 | Display Max, Average 150 | Close MarksData 160 | END Analysis The algorithm does not produce the expected output. The file MarksData contains the values: (a) | Complete a desk check for this algorithm using the values stored in MarksData. | 3 (b) | Suggest how the algorithm can be modified so that it achieves the correct | 3 output. You may refer to line numbers in your response.

Marking criteria

[Question 23 (a)] Criteria | Marks • Completes a substantially correct desk check | 3 • Completes a partially correct desk check | 2 • Provides some relevant information | 1 Criteria | Marks • Provides the necessary modifications | 3 • Provides ONE correct modification OR | 2 • Identifies TWO errors • Provides some relevant information | 1

Sample answer

Sample answer: Max | Num_Students | Mark | Average | Output 4 | 10 | 100, 10

[Question 23 (b)] Sample answer: Line 20 should be Max = 0 Line 15 Sum = 0 Line 95 Sum = Sum + Mark Line 110 change to Average = Sum/Num_Students

Question page · Practise and get marked