Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Created December 14, 2015 03:03
Show Gist options
  • Save ryanmr/27166e13bfea5965a6ba to your computer and use it in GitHub Desktop.
Save ryanmr/27166e13bfea5965a6ba to your computer and use it in GitHub Desktop.
; 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