Created
December 14, 2015 03:03
-
-
Save ryanmr/27166e13bfea5965a6ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; income-tax | |
; arguments: 3 | |
; income - the income on which to be taxed | |
; algorithm: | |
; first 35k @ 15% | |
; second 65k @ 25% | |
; third 10k @ 35% | |
; state-first 50k @ 5% | |
(define (income-tax income) | |
(define (state-tax income) | |
(define (state-tax-subtract income) | |
(- income 50000) | |
) | |
(define (state-tax-calc income) | |
(* .05 (state-tax-subtract income)) | |
) | |
(if (> income 50000) (state-tax-calc income) 0) | |
) | |
(define first in) | |
(* .15 in) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment