TK Study

Past questions › sdd2024-q26

2024 6 marks Extended response The Software Engineering Project (Year 12) Context diagram; subroutines

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

Many software applications use a software generated test to deter automated spam attacks by confirming that data is being entered by a human. An example of such a test, named CheckIfHuman, is shown. Type the characters shown above: CONTINUE The user is required to type the displayed characters into the dialogue box. The system checks if there is a match, and generates a flag. (a) | Create a context diagram to model the CheckIfHuman test. | 2 (b) | In the following code, CheckIfHuman is called to confirm that the correct text | 4 characters have been entered before proceeding. BEGIN Main OK = TRUE REPEAT HumanDetected = CheckIfHuman IF HumanDetected THEN DisplayMessage (HumanDetected) DoMainProcessing OK = TRUE ELSE DisplayMessage (HumanDetected) OK = FALSE ENDIF UNTIL OK = TRUE END Main Explain why it is important that CheckIfHuman and DisplayMessage are implemented as subroutines for this application.

Marking criteria

[Question 26 (a)] Criteria | Marks • Creates a substantially correct context diagram | 2 • Creates a recognisable attempt at a context diagram | 1 Criteria | Marks • For BOTH subroutines, explains the importance of implementing the logic as subroutines • For ONE of the subroutines, explains the importance of implementing the logic as a subroutine • Outlines ONE advantage of using a subroutine | 2 • Demonstrates some understanding of subroutines | 1

Sample answer

Sample answer:

[Question 26 (b)] Sample answer: It is useful to define CheckIfHuman as a subroutine to allow for further developments in the relevant technology. It is a trivial matter to replace the current logic for the subroutine with code that utilises the new technology, while still providing the same output, ie a success flag. DisplayMessage appears to be a generic subroutine that appropriately formats and displays a relevant message. This makes it easy to change the overall format of the display if required, once only, in the updated subroutine. It is also easy to allow for the inclusion of a much larger range of messages in the future, simply by increasing the numbers of variables that are appropriately initialised and passed to the subroutine.

Question page · Practise and get marked