Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Racket programming language 1. Write a function is_older that takes two dates and evaluates to true or false. It evaluates to true if the

In Racket programming language

1. Write a function is_older that takes two dates and evaluates to true or false. It evaluates to true if the first argument is a date that comes before the second argument. (If the two dates are the same, the result is false.)

(* Function that receives two birth dates YYYY MM DD and returns true if the first is older than the second. If not then returns false *)

(* Done using tuples *)

2. Write a function number_in_month that takes a list of dates and a month (i.e. an int) and returns how many dates in the list are in the given month.

(* Function that receives a list of birth dates (tuples YYYY MM DD) along with a given month and returns how many of date tuples have that month *)

(* Done using a list of tuples *)

3. Write a function number_in_months that takes a list of dates and a list of months (i.e., an int list) and returns the number of dates in the list of dates that are in any of the months in the list of months.

(* Hint you can use the number_in_month function to make this easier *)

(* A function that finds all the dates that match the month given outputting the tuples in the order found *)

4. Write a function dates_in_month that takes a list of dates and a month (i.e., an int) and returns a list holding the dates from the argument list of dates that are in the month. The returned list should contain dates in the order they were originally given.

To make your life easier you may want to write an append function to be used in this one. It should take two list and append the second onto the first. You can Google this part or write your own as it is not much to do.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions