Solution in English (Continued from problem 4):
- Get the airport they arrived at (input) and store in airportArrived (variable)
- Get travel time from Smits Airfield to Atlas (input) and store in smitsTravel
- Get travel time from Courtenay Airfield to Atlasq (input) and store in courtenayTravel
- Compare aiportArrived to courtenayAirfield to see if they match
- If true then book a taxi from the Courtenay airfield (output)
- If true then add courtenayTravel to arrivalTime to get booking time store in dinnerBook (variable)
- If false then book a loaner car from Smits airfield (output)
- If false then add SmitTravel to arrivalTime to get booking time (input) and store in dinnerBook (variable)
- Get Atlas Cafe reservation times (input) and store in atlasBooking(Variable)
- Compare bookTime to atlasBooking
- If they are less than or equal to then book that time
- If they are greater than:
- Check to see if there is another booking
- If there is no other booking they are out of options
Solution as Flowchart:
Leave a Reply