[racket] Basic Racket Question

From: Sayth Renshaw (flebber.crue at gmail.com)
Date: Tue Dec 21 06:50:09 EST 2010

I am sure I am trying to over define this but not sure how to use other
methods in Racket yet only beginning. So Hi everyone.

Doing the netpay of employee tax = 0.15 and pay = hrs *12. From the beginner
tutorial. I see two ways a simple and a hard way but neither work.

Hard  way

(define (hours h)
  (h : number?))
(define (tax t)
  (= t 0.15))
(define (payrate p)
  (= p $12.00))
(define (netpay hours tax payrate)
  (* h p)-(* t(* h p)))

Easy Way

(define (netpay hours : number? tax : 0.85)
  (* hours 12)* tax)

What is the best way?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101221/ae31b141/attachment.html>

Posted on the users mailing list.