Now suppose that we want to retrie ve entries from the database that satisfy certain constraints. For examp le, we might want to get all the entries of people with the position of "hacker", or we might want to get the entries of people who se fir st name is "Jane", or all the entries of peop le with salaries between 25000 and 50000, Remember our pro cedure: (de fine (filter pred 1st) (cond ((null? ist) nil) ((pred (car 1st)) (cons (car 1st) (filter pred (cdr lst)))) (else (filter pred (cdr 1st))))) Question 9: We want a way of getting entries from the database with a particular first name (where by first name, we mean the first of the "given" names, not the family name). You may assume that every entry in the database has at least one given name. You may also find the pro cedure string=?, which compares two strings, to be useful. Complete the followi ng code so that, for example, (filter (called-by "jane") sanpledat a) ;Value: ((("doe" "jane" "eli zabeth") 38000 "assist ant ")) (define (called-by name)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Now suppose that we want to retrie ve entries from the database that satisfy certain constraints.
For example, we might want to get all the entries of people with the position of "hacker", or we
might want to get the entries of people who se fir st name is "Jane", or all the entries of peop le with
salaries bet ween 25000 and 50000. Remember our pro cedure:
(de fine (filter pred 1st)
(cond ((null? 1st) nil)
((pred (car 1st)) (cons (car lst) (filter pred (cdr 1st))))
(else (filter pred (cdr 1st)))))
Question 9: We want a way of getting entries from the database with a particular first name
(where by first name, we mean the first of the "given" names, not the family name). You may
assume that every entry in the database has at lkast one given name. You may also find the
pro cedure string=?, which compares two strings, to be useful.
Complete the followi ng code so that, for example,
(filter (called-by "jane") sanpledat a)
;Value: ((("doe" "jane" "eli zabeth") 38000 "assist ant "))
(define (called-by name)
Transcribed Image Text:Now suppose that we want to retrie ve entries from the database that satisfy certain constraints. For example, we might want to get all the entries of people with the position of "hacker", or we might want to get the entries of people who se fir st name is "Jane", or all the entries of peop le with salaries bet ween 25000 and 50000. Remember our pro cedure: (de fine (filter pred 1st) (cond ((null? 1st) nil) ((pred (car 1st)) (cons (car lst) (filter pred (cdr 1st)))) (else (filter pred (cdr 1st))))) Question 9: We want a way of getting entries from the database with a particular first name (where by first name, we mean the first of the "given" names, not the family name). You may assume that every entry in the database has at lkast one given name. You may also find the pro cedure string=?, which compares two strings, to be useful. Complete the followi ng code so that, for example, (filter (called-by "jane") sanpledat a) ;Value: ((("doe" "jane" "eli zabeth") 38000 "assist ant ")) (define (called-by name)
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY