Create a function high-tides that consumes a list of tide structures tidelist and a number threshold and produces the list of day-time structures for each tide in tidelist with height greater than threshold. The order of day-time structures in the list produced should follow the order in the list consumed. Create a function high-tides that consumes a list of tide structures tidelist and a number threshold and produces the list of day-time structures for each tide in tidelist with height greater than threshold. The order of day-time structures in the list produced should follow the order in the list consumed. @Computer Science
(define-struct date (month day)) ;; A date is a structure (make-date m d), where ;; m is an integer in the range 1 to 12, and ;; d is an integer in the range 1 to 31 where ;; m and d represent a day in a non-leap year. ;; (define-struct tide (date time height)) ;; A tide is a structure (make-tide d t h), where ;; d is a date ;; t is an integer in the range 0 to 23 representing an hour in 24-hour time ;; h is a positive number representing the height of the tide ;; (define-struct day-time (day time)) ;; A day-time is a structure (make-day-time d t), where ;; d is a date, and ;; t is an integer in the range 0 to 23 representing an hour in 24-hour time
Step 1: Write the function definition (with an empty body) as they described. I think you can handle this with a predicate function that takes a tide. But you also need to filter based on the tide height threshold. So maybe you have to write a function that takes a threshold and returns a lambda that you can use as the predicate. Then filter the incoming list with that predicate.
Join our real-time social learning platform and learn together with your friends!