Laboratory 1
Email to me solutions by 11:59 on Thurs 3 Sep.
- Write a procedure which takes three numbers as arguments
and returns the median of the values.
- Write a procedure called simple-tax which computes the
amount of income tax owed based on the following formula:
If you make $25000 or less, you owe no tax.;
Otherwise, your tax rate is 10% on the amount over $25000
; For example: (Uncomment and use as test cases when you're done)
; (simple-tax 15000) ; => 0
; (simple-tax 25000) ; => 0
; (simple-tax 26000) ; => 100
; (simple-tax 50000) ; => 2500
- exercises 1.3, 1.4, 1.5, 1.6 in the text
The solutions to ex 1.4, 1.5 and 1.6
should be prose explanations. You may try stuff in drscheme to
help you figure out what is going on.
The solutions to ex 1.3, the median problem, and simple-tax should be
working, debugged scheme procedures with evidence of testing.
Charles Kelemen
Last modified: Fri Aug 28 14:00:27 EDT 2009