<br><br><div class="gmail_quote">On Sun, Jan 2, 2011 at 6:05 AM, Stephen Bloch <span dir="ltr">&lt;<a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a>&gt;</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;">
Another solution, which doesn&#39;t require any language features you don&#39;t know yet, is to write a helper function that takes in the gross pay and computes the net pay from it.  Your main function then calls this new helper function on the result of your &quot;pay&quot; function.  The &quot;pay&quot; function is called only once, and your new helper uses the result twice.<br>

<font color="#888888"><br>
Stephen Bloch<br>
<a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a></font></blockquote></div><br><br>I can&#39;t quite get it to happen at the moment. But is this more the style you were referring to...However it doesn&#39;t like me embedding one function in the definition of another. will have to keep thinking :-)<br>
<br>(define (netpay hours)<br>  (* 12 hours))<br><br>(define (tax (netpay hours))<br>  (cond<br>    [(&lt;= netpay 240) 0]<br>    [(&lt;= netpay 480) (* 0.15 netpay)]<br>    [(&gt; netpay 480) (* 0.28 netpay)])) <br>    <br>
(define (mypay hours)<br>  (- (netpay hours)(tax hours)))<br>