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)
Leave a Reply