[racket] exercise problem

From: Stephen Bloch (bloch at adelphi.edu)
Date: Tue Feb 21 14:51:35 EST 2012

On Feb 21, 2012, at 2:43 PM, Roelof Wobben wrote:

> But now I get this error message : 
> unsaved editor>:27:23: function call: expected a function after the open parenthesis, but found a part in: (tarief1 amount)
> 
> When I do (tarief 1 amount) instead of ((tarief amount))

Yes, that's where the syntax error is.  So you've fixed that.

> I don't get the error message but the outcome of (payback 2600) is not right.

Several questions:

1) Have you written a complete set of test cases, with right answers, using "check-expect"?  Since there are four categories of input for this problem, you need at least four test cases, and you should probably have three more for the boundaries, a total of seven test cases.

2) Which of these test cases produced wrong answers, and which (if any) produced right answers?  You can use the pattern of right and wrong answers to track down where the problem is.

3) Have you used the Stepper to watch what your program is doing?



Stephen Bloch
sbloch at adelphi.edu



Posted on the users mailing list.