Solution:-
• Calculate the delay time and store it in a variable, “delayTime”.
• Calculate the new leave time by adding “delayTime” to the leave time, and store it in a variable, “newLeaveTime”.
• Calculate the new trip length by adding the delay time to the “triplength”, and store it in a variable, “newTripLength”.
• Calculate the new landing time by adding “newTripLength” to the “newLeaveTime” and store it in a variable, “newLandingTime”.
• Check the next available landing time and store it in a variable, “nextAvailableTime”.
• Compare the “nextAvailableTime” and “newLandingTime”.
a. If “newLandingTime” is earlier than “nextAvailableTime”, make plans to land at Courtenay airfield else.
b. If “newLandingTime” is later than “nextAvailableTime”, default to Smits Field.