|
home—lectures—recipe—exams—hws—D2L—breeze (snow day; distance)
The following problems can be completed for extra-credit (in the homework category). Due: Wednesday 23:59 of the last week of classes. (You are encouraged to complete and submit work much earlier, to avoid the time-crunch). However, they will not be graded until the end of finals week. You are encouraged to come by office hours with questions, and/or ask on the D2L discussion board.
Challenge problems are not meant to replace missing assignments: the regular homeworks are crafted to cover the topics that are the primary goal of the course. Challenge problems, on the other hand, may take existing topics further than we have time for in class, or they might cover topics that were covered only peripherally in class. They typically require a level-of-understanding gained by completing the regular homeworks.
Hint: To multiply m and n: make a function which takes any number andadd s m to it; then, iterate that function n times. Apply that iterated-function to the number you want to start adding-m from.
(5pts) Recall how the template for lists has two “
If you think about it, the list-processing-template is repeated code;
we should write a single general-purpose function,
and then ust call that function, instead of repeating code.
That's what the function
Indeed, the code for
(define (foldr combine base lst) (cond [(empty? lst) base] [(cons? lst) (combine (first lst) (foldr combine base (rest lst)))])) |
Write
Do not call
To compare items:
In racket, use
Here is the full grammar for JSON. For this exercise, we'll simpify things slightly:
As usual, follow the entire design recipe (incl. data-definition (which will be very similar to the grammar), examples of data before you start writing any functions, function test-cases before you start writing any function-code, etc.).
home—lectures—recipe—exams—hws—D2L—breeze (snow day; distance)
©2017, Ian Barland, Radford University Last modified 2017.Dec.07 (Thu) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |