view src/rlm/expenses.clj @ 0:78a630e650d2

initial import
author Robert McIntyre <rlm@mit.edu>
date Tue, 18 Oct 2011 00:57:08 -0700
parents
children
line wrap: on
line source
1 (ns rlm.expenses)
4 (def static-expenses
5 [500 ;; for Books
6 600 ;; to get to Wisconsisn
7 200 ;; install internet satelite
8 1000 ;; shipping
9 ])
12 (def monthly-expenses
13 [600 ;; rent
14 120 ;; internet
15 120 ;; vehicle maintance
16 600 ;; stipend (food, gas)
17 ])
19 (defn cost-per-month [num-months]
20 (float
21 (/
22 (+
23 (* num-months (reduce + monthly-expenses))
24 (reduce + static-expenses))
25 num-months)))