34 lines
662 B
Common Lisp
34 lines
662 B
Common Lisp
|
(load "unit-test.lisp")
|
||
|
(load "compound.lisp")
|
||
|
|
||
|
(unit
|
||
|
(list
|
||
|
|
||
|
(defun many-years-with-no-interest-rate ()
|
||
|
(eq (compound 100000 0 10) 100000)
|
||
|
)
|
||
|
|
||
|
(defun no-years-with-positive-interest-rate ()
|
||
|
(eq (compound 100000 10 0) 100000)
|
||
|
)
|
||
|
|
||
|
(defun one-year-with-positive-interest-rate ()
|
||
|
(eq (compound 100000 5 1) 105000)
|
||
|
)
|
||
|
|
||
|
(defun two-years-with-positive-interest-rate ()
|
||
|
(eq (compound 100000 5 2) 110250)
|
||
|
)
|
||
|
|
||
|
(defun three-years-with-positive-interest-rate ()
|
||
|
(eq (compound 100000 5 3) 115763)
|
||
|
)
|
||
|
|
||
|
(defun four-years-with-positive-interest-rate ()
|
||
|
(eq (compound 100000 5 4) 121551)
|
||
|
)
|
||
|
|
||
|
)
|
||
|
)
|
||
|
|