Solution (in English):
- Find out (input) 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 āearliestLandingTimeā
- Find out how much extra time Mary and Louise are going to take. Store it in a variable called āextraTimeā
- Calculate āearliestLandingTimeā plus āextraTimeā. Store it in a variable called ānewLandingTimeā
- Find out the available landing times. Store it in a variable called āavailableTimesāĀ
- Compare ānewLandingTimeā to each āavailableTimesāĀ
- If āavailableTimeā is earlier than ānewLandingTimeā, move to the next āavailableTimeā
- If there is āavailableTimeā that match ānewLandingTimeā, land in Courtenay
- If there is noĀ āavailableTimeā that match with ānewLandingTimeā, default to Smits Field
Flowchart:

Leave a Reply