Problem 2: Decide if a Courtenay landing is safe

While on route, Mary receives a dangerous wind warning for the Courtenay area. She knows that if winds are greater than 12 knots, she can’t land safely because the Courtenay airfield is close to the ocean and has high winds. Smits Field is a nearby airfield that is protected from the wind and allows emergency landings but it’s a 30 minute drive to Courtenay and Louise would need to contact the airstrip marshall to reserve the loaner car they make available for such occasions. Write an algorithm that will tell Mary if she can land in Courtenay or if she has to go to Smits Field. (Note: you can name your variables whatever you want)

 

Solution (in English)

  • Start
  • Find out (input) how strong the wind is blowing. Store it in a variable called ‘windStrength’
  • Find out when Mary and Louise are scheduled to land. Store it in a variable called ‘arrivalTime’
  • Calculate windStrength at arrivalTime store as “originalLanding”
  • If Landing is less than 12 knots, ‘originalLanding’ in courtenay
  • If originalLanding is greater than 12 knots, then reroute Mary and Louise to Smits Field airfield for Newlanding
  • stop

 

Solution (flowchart)