A marine biologist has defined a record structure Whale to store details about tracked whales.
RECORD Whale
whaleID : String
lastSighted : String
migrationDistance : Real
ENDRECORD
W1 ← Whale("Orca-92", "Pacific Ocean", 4520.8)
W2 ← Whale("Blue-11", "Indian Ocean", 4110.3)
Write an algorithm using pseudo-code to display the ID of the whale with the longest migration distance.
The algorithm should:
Tie if both whales have the same migration distanceThe algorithm should work for any valid whale records stored in W1 and W2.
208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.