[racket] exercise problem
On Feb 1, 2012, at 1:55 PM, Roelof Wobben wrote:
> So in my opion I can solve this at this way :
>
>
> grosspay = hours_work * 12,5
> tax = grosspay * 0,15
> netpay = grosspay - tax.
>
> So I did this :
>
> (define (grosspay h)
> (* h 12.50))
>
> (define (tax grosspay)
> ( * grosspay 0.15))
>
> (define (nettoloon grosspay tax)
> (- grosspay tax))
>
> But when I do :
>
> (grosspay 1)
When I do so, I get 12.5.
> I get a message that there a 2 variables and one is given.
> So the other functions are not executed.
I assume you mean
(nettoloon 1)
and then you get the message. Yes you do -- because the function
nettoloon takes two arguments: grosspay and tax. The goal of the
exercise is to create nettoloon so that it consumes one argument,
namely, the number of hours worked. From that it computes the net
wage.