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 (in English)

  • Start
  • Find out when Mary and Louise will likely land. Store it in a variable called ‘estimatedLanding’
  • Find out the available landing times. Store it in a variable called ‘availableTimes’
  • Compare estimatedLanding to each availableTime
  • If availableTime is earlier than 6pm, book this time as origianlLanding
  • if availableTime is later than 6pm, then reroute Mary and Louise to Smits Field airfield for newLanding
  • end

 

Solution (flowchart)