Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Company XYZ & Co. pays all its employees $12 per hour. A typical employee works between 20 and 65 hours per week. Develop a program that determines the wage of an employee from the number of hours of work.
- Exercise 2.3.1. Utopia's tax accountants always use programs that compute income taxes even though the tax rate is a solid, never-changing 15%. Define the program tax, which determines the tax on the gross pay.
- Also define netpay. The program determines the net pay of an employee from the number of hours worked. Assume an hourly rate of $12
- answer from random site i found:
- (define (wage h)
- (* 12 h))
- define (tax i)
- (* i 0.15)
- (define (netpay h)
- (- (wage h) (tax h)))
- my answer:
- (define (wage h)
- (* 12 h))
- (define (tax i)
- (* i 0.15))
- (define (netpay h)
- (- (wage h) (tax (wage h))))
Add Comment
Please, Sign In to add comment