0203

Problem 3: Find an alternate landing time / location

Wind was less than 12 knots so Mary could safely land in Courtenay, but the wind conditions delayed their leave time and has slowed down their travel so that their overall travel time is longer than expected. Mary will not make her booked landing time. Write an algorithm that will determine if there is a later landing time available in the Courtenay airfield. If not, she will have to default to Smits Field.

Solution (English)

  • Input expected delayed arrival time ( timeArrival ) & list of available landing times ( timeLandings )
  • Compare arrival time to first item in available landing time list
  • If found (equal to) print, “Courtenay Available”
  • If not found, compare to next untested landing time.
  • If no more times to compare to, print, “Proceed to Smits Field”

Solution (flowchart)

← Previous Post

Next Post →

1 Comment

  1. This is correct.

Leave a Reply