Pseudocode repeat-until excursion risk rating

2025-hsc-se-q17 · Code Response · 3 marks

Source: NESA 2025 HSC Software Engineering HSC Q17

Question

An algorithm is required by a school to rate the risk of a location for school excursions.

A teacher completes a 10-question survey to assess potential hazards for the location. Each question is given a score from 1 (low) to 5 (high), and the scores are stored in a 10-element integer array called Risks.

The scores for each question are added to give a total risk score.

The excursion risk is rated as:

  • Low (total less than 20)
  • Medium (total between 20-35)
  • High (total above 35).

Using pseudocode, with a repeat-until loop, write an algorithm to determine the excursion risk rating for a location. You can assume that the scores for the 10 questions are already stored in the array Risks.

Response

Reveal answer
BEGIN RiskRating
  Total = 0
  index = 0
  REPEAT
    Total = Total + Risks[index]
    index = index + 1
  UNTIL index = 10

  IF Total > 35 THEN
    Rating = "High"
  ELSEIF Total < 20 THEN
    Rating = "Low"
  ELSE
    Rating = "Medium"
  ENDIF

  Display Rating
END RiskRating

Marking rubric

MarksDescription
3Provides a substantially correct pseudocode algorithm.
2Provides a pseudocode algorithm that addresses some aspects of the problem.
1Shows some understanding of the problem or pseudocode.

Explanation

The algorithm needs to total all 10 scores using a repeat-until loop and then select the correct rating from the total.

Metadata

Submitter
Seed data
Created
2026-05-02
Status
published
Syllabus
y12-project-tools-for-ideas-solutions
Tags
pseudocode repeat-until arrays selection risk rating