TK Study

Past questions › sdd2022-q30

2022 5 marks Extended response The Software Engineering Project (Year 12) Algorithm design (arrays)

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

Results( ) is an array containing 200 records. | 5 The following table shows a sample of the array contents. Index | Name | Score 1 | Jones B | 23 2 | Ali B | 45 3 | Morris S | 8 4 | Nguyen T | 45 200 | Shankar R | 8 Write an algorithm that: • displays the highest score and the names of all people who have that score • displays the second highest score and the names of all people who have that score.

Marking criteria

[Question 30] Criteria | Marks • Provides a substantially correct algorithm that addresses the following features: – Initialises highest score – Determines highest score by looping through the array – Displays the highest score – Loops through the whole array, printing names of all players with the highest score – Repeats the above for the second highest score • Provides a substantially correct algorithm that addresses most of the features • Provides an algorithm that attempts to address some of the features | 3 • Provides an algorithm that attempts to address a feature | 2 • Shows some understanding of the problem | 1

Sample answer

Sample answer: BEGIN first = 0 second = 0 FOR i = 1 to 200 IF Results.Score(i) >= first THEN first = Results.Score(i) ELSE IF Results.Score(i) > second THEN second = Results.Score(i) ENDIF ENDIF NEXT print "Highest score was " first FOR i = 1 to 200 IF Results.Score(i) = first THEN print = Results.Name(i) ENDIF NEXT print "Second highest score was " second FOR i = 1 to 200 IF Results.Score(i) = second THEN print = Results.Name(i) ENDIF NEXT END

Question page · Practise and get marked