Python bonus points for game rounds
2025-familiarisation-se-q13 · Code Response · 6 marks
Source: NESA 2025 HSC Software Engineering Familiarisation Q13
Question
In a computer game, each player has 10 rounds and the maximum score for each round is 5. The score for each round is equal to the number of points, except when bonus points are assigned. Every time a player scores 5, the score from the next round is added as bonus points. If a player scores 5 in the last round, they get 10 points.
A player's scores and corresponding points for a full game are shown.
| Round | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Score | 3 | 5 | 5 | 2 | 1 | 4 | 0 | 1 | 4 | 5 |
| Points | 3 | 10 | 7 | 2 | 1 | 4 | 0 | 1 | 4 | 10 |
Write a program in Python that will:
- display the player's scores and corresponding points
- calculate and display the total points for the player, taking into account the bonuses.
Start your program with: scores = [3,5,5,2,1,4,0,1,4,5]
The output should match the table shown in the question, ending with TOTAL POINTS: 42.
Response
Reveal answer
scores = [3, 5, 5, 2, 1, 4, 0, 1, 4, 5]
points = []
for index, score in enumerate(scores):
if score == 5:
if index == len(scores) - 1:
points.append(10)
else:
points.append(score + scores[index + 1])
else:
points.append(score)
print("Round Score Points")
for index in range(len(scores)):
print(index + 1, " ", scores[index], " ", points[index])
print("TOTAL POINTS:", sum(points))
Marking rubric
| Marks | Description |
|---|---|
| 6 | Provides correct Python that calculates bonus points, displays round data and total points. |
| 4 | Provides mostly correct Python with minor errors. |
| 2 | Shows partial use of loops, lists or bonus logic. |
| 1 | Shows some relevant Python programming knowledge. |
Explanation
The special case is a score of 5. It earns the current round score plus the next score, except in the last round where it earns 10.
Metadata
- Submitter
- Seed data
- Created
- 2026-05-02
- Status
- published
- Syllabus
- y12-project-design-construct-implement-solution
- Tags
- Python arrays loops game scoring