<br><br><div class="gmail_quote">On Mon, Jan 3, 2011 at 1:19 AM, Stephen Bloch <span dir="ltr"><<a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
> ; net-pay: number -> number<br>
> ; given gross pay, produces net pay<br>
> (define (net-pay gross-pay)<br>
> (- gross-pay (tax gross-pay)))<br>
><br>
> Ah okay, I was using hours as the only user input to have a whole function calculate netpay of one input.<br>
<br>
</div>Yes, you should still do that. The above is just a helper function (like "pay"); it's not the function you tell the users about. Perhaps a better name for it would be "deduct-tax", leaving the original name "net-pay" free to be used for the function that takes in hours and returns net pay.<br>
<div><div></div><div class="h5"><br>
Stephen Bloch<br>
<a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a></div></div></blockquote></div><br><br>Unfortunately I think I must be blind to this solution, I have done the exercises after and had no problem. I have re-writeen this one too many times I have lost focus.<br>
<br>This is where I was embedding a function again.<br><br><br>(define (gross hours)<br> (* 12 hours ))<br>(define (pay (gross hours))<br> (cond<br> [(>= gross 480) (+(*(- gross 480)0.28)36)]<br> [(>= gross 240) (*(- gross 240)0.15)]<br>
[(< gross 240) 0]))<br> <br>