Question: ****PLEASE USE THE SCHEME/RACKET LANGUAGE. USE ONLY THE SCHEME/RACKET LANGUAGE***** 4. Design and implement a SCHEME object that represents a library. Your library should be

****PLEASE USE THE SCHEME/RACKET LANGUAGE. USE ONLY THE SCHEME/RACKET LANGUAGE*****

****PLEASE USE THE SCHEME/RACKET LANGUAGE. USE ONLY THE SCHEME/RACKET LANGUAGE***** 4. Design

4. Design and implement a SCHEME object that represents a library. Your library should be able to store book objects. You should be able to create a library by evaluating the make-library function which takes no param- eters. Therefore, the library starts with no books. Your library object should expose the following functions add - which takes one parameter, a book object, and stores it inside the library . find-author - which takes one string as a parameter, the author's name, and returns a list of author/title pairs (as a pair of strings) for all book objects in the library which were written by that author . find-title - which takes one string as a parameter, the title of the book(s) you wish to find, and returns a list of author/title pairs for all book objects in the library which share that title You should be able to test your code with the following test data: (define mylib (make-1ibrary)) ((mylib 'add) (make-book "Harry Potter and the Philosopher 's Stone" "Rowling")) ((mylib 'add) (make-book "Harry Potter and the Chamber of Secrets""Rowling")) ((mylib 'add) (make-book "Harry Potter and the Prisoner of Azkaban" "Rowling")) ((mylib 'add) (make-book "Harry Potter and the Goblet of Fire "Rowling")) ((mylib 'add) (make-book "Harry Potter and the Order of the Phoenix""Rowling")) ((mylib 'add) (make-book "Harry Potter and the Half-Blood Prince" "Rowling")) ((mylib 'add) (make-book "Harry Potter and the Deathly Hallows" "Rowling" )) ((mylib 'add) (make-book "The Hunger Games" "Suzanne Collins")) ((mylib 'add) (make-book "Catching Fire" "Suzanne Collins")) ((mylib 'add) (make-book "Mockingjay" "Suzanne Collins")) ((mylib 'add) (make-book "The Magician" "Michael Scott")) ((mylib 'add) (make-book "The Magician" "W. Somerset Maugham")) ((mylib 'find-title) "The Magician") ((mylib 'find-author) "Suzanne Collins") ((mylib 'find-author) "Rowling")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!