-
Notifications
You must be signed in to change notification settings - Fork 3
/
bolnjak.lisp
35 lines (27 loc) · 1.31 KB
/
bolnjak.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(defparameter *months* '((1 January)
(2 February)
(3 March)
(4 April 120)
(5 May 120)
(6 June 120)
(7 July 120)
(8 August 120)
(9 September 90)
(10 October 90)
(11 November 90)
(12 December)))
(defparameter *average* (/ (loop :for month :in *months* :when (not (null (nth 2 month)))
:sum (nth 2 month))
(coerce (length *workmonths*) 'single-float)))
(defparameter *avg-months* (loop :for month :in *months*
:collect
(if (null (nth 2 month))
(append month (list *average*))
month)))
(defparameter *average-per-month* (/ (loop
:for month
:in *avg-months*
:sum (nth 2 month))
12.0))
(defparameter *average-per-day* (/ (* 24 *average-per-month*) 730.0))
(defparameter *result* (* (/ (* *average-per-day* 9) 100.0) 60)