1. ## Algorithm (PSEUDOCODE HELP)

For software homework I need to create a pseudocode algorithm which reads a list of best scores (up to 5) from a sequential file and determines whether the current score (in a game) should be inserted into the list (leaderboard)

USING:
Algorithm from the HSC Past Paper:
Code:
```BEGIN swap(x)
temp = TOPPLAYERS[x]
TOPPLAYERS[x] = TOPPLAYERS[x-1]
TOPPLAYERS[x-1] = temp
END swap

IF newscore > TOPPLAYERS[10].totalscore THEN
TOPPLAYERS[10].totalscore = newscore
TOPPLAYERS[10].name = newname
found = false
x =10
WHILE found = false AND x > 1
IF TOPPLAYERS(x).totalscore > TOPPLAYERS[x – 1].totalscore THEN
swap(x)
x = x – 1
ELSE
found = true
ENDIF
ENDWHILE
ENDIF```

And the Standard Sequential File Algorithms (via Course Specifications page 65-66)

https://www.boardofstudies.nsw.edu.a...urse-specs.pdf

2. ## Re: Algorithm (PSEUDOCODE HELP)

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•