![]() |
![]() |
|
home—lectures—recipe—exams—hws—D2L—breeze (snow day)
Due:
Section 01: Sep.08 (Mon) 23:59, on D2L and hardcopy on Wednesday
Section 11: Sep.09 (Tue) 23:59, D2L.
Your submitted file should be named “hw02.rkt” as plain-text (which is
what DrRacket saves as).
Standard instructions for all homeworks:
Open DrRacket (either in labs, or you can download it to your own computer from racket-lang.org). The first time you start DrRacket, it will ask you to choose a language; select Language > Use Language... > Teaching Languages > Beginning Student, for now.
Follow the design recipe, steps 4,5,7,8.
hint:You can avoid needingif orcond with a clever (but standard) use ofmin ormax .
Data definition: A directory-response is one of:
(15pts) Write a function which, given a directory-response, returns a string: either
(You can think of this function as being one part of a larger program which queries a campus-directory, such as radford's, and then has to use the response it gets.)
To think about:
As per the design recipe
since our data-definition has three different variants,
you will have a
1 If in doubt about exactly what constitutes a suffix, here's a definition: We say that string b is a suffix of a if there exists a string p such that a equals p concatenated to b.
We'll see later how, in a declarative language (Prolog), this definition is runnable code.
↩home—lectures—recipe—exams—hws—D2L—breeze (snow day)
©2014, Ian Barland, Radford University Last modified 2014.Oct.28 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |