Problem 4: Book a dinner reservation
While Mary is figuring out which airfield to land in, Louise needs to book a reservation at the Atlas Cafe. She was given a list of open times for the reservation. Based on the place they land, she needs to add 20 minutes (Courtenay) or 45 minutes (Smits Field) to their landing time to determine the reservation time. She also needs to book either a taxi (Courtenay) or the airfield loaner car (Smits Field). Write an algorithm that will take the necessary outputs from Problem 3 and determine which reservation time and mode of transportation she needs to book.Ā (You do not need to duplicate 3, just start 4 as if adding on to 3)
Solution (English)
- Would need to ārecordā (put into memory) result of Problem number 3, create a var āfieldArrivalā
- If result was NO (Smits Field), store āfalseā in var āfieldArrivalā
- If result was YES (Courtenay), store ātrue in var āfieldArrivalā
- If value is ātrueā, var ātimeAddā equals ā20ā & var ātravelVehicleā equals āTaxiā
- If value is āfalseā, var ātimeAddā equals ā45ā & var ātravelVehicleā equals āLoaner Carā
- Output (Add ātimeAddā minutes for reservation and call a ātravelVehicleā for pick-up.)
mwilson
That works too.
Here is my version: https://docs.google.com/document/d/1Mv4ZhDj3SjXL3M5hE1gY2XjY9Kb_1EUrU0-dg3abN14/edit?usp=sharing