Solution (in English)Ā 

  • Find out how long the trip will take from take off to landing. Store it in a variable called ā€˜tripLength’ 
  • Find out when Mary and Louise are able to leave. Store it in a variable called ā€˜leaveTime’ 
  • Calculate leaveTime plus tripLength. Store it in a variable called ā€˜minTime’
  • Find out the available landing times. Store it in a variable called ā€˜availableTimes’ 
  • Compare minTime to each availableTimeĀ 
  • If availableTime is earlier than minTime, move to the next availableTimeĀ 
  • if availableTime is equal to or later than minTime, book this time

Solution (flowchart)