Problem 4: 1B- 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.
Solution (in English)
- Calculate the landing location and store it in a variable “landLocation”.
- If the landing location is in Courtenay, calculate the reservation time by adding 20 minutes to “newLandTime”
- Booking a taxi to Atlas café.
- If the landing location is in Smits Field, calculate the reservation time by adding 45 minutes to the “newLandTime”.
- Booking of the airfield loaner car.
Leave a Reply