;;; gravy.el: calculate how much money fell out of the sky onto each of us. ;;; ;;; Instructions: load this file, then run "M-x gravy". ;;; ;;; Notes: The math assumes that capital gains is a percentage taken ;;; from the profits. (defun gravy () (interactive) (let* ((buf (get-buffer-create "*Gravy*")) ;; First we figure out how big a bowl of gravy this is (investment 4200.0) ; The total amount we put in (gross-receipts 33977.42) ; What got wired into Karl's account (taxable-gains (- gross-receipts investment)) (tax-rate 0.40) ; Uncle Sam do care about the rest (after-taxes (- gross-receipts (* taxable-gains tax-rate))) ;; Then we figure out how much of it Karl has already eaten (wire-out-fee 25.0) ; Karl paid to send a wire transfer (wire-in-fee 25.0) ; Karl probably paid for wire in, too (FedEx-fee 15.0) ; Karl mails documents with all speed (deutsche-banc-fee 53.0) ; Their brochure lists this charge (kinkos-krap 5.0) ; We need copies of all forms (karl-tax-accountant 80.0) ; (est.) (H.R. Block of 2 years ago) (misc-expenses (+ wire-out-fee wire-in-fee FedEx-fee deutsche-banc-fee kinkos-krap karl-tax-accountant)) ;; So the total volume of gravy remaining is... (net-receipts (- after-taxes misc-expenses)) ;; And each of us gets a portion thusly: (lefty-percentage 17.8571) ; Lefty put in $750 of $4200 (fitz-percentage 52.8571) ; Fitz put in $2220 of $4200 (karl-percentage 29.2857) ; Karl put in $1230 of $4200 (lefty-net (* net-receipts (/ lefty-percentage 100))) (fitz-net (* net-receipts (/ fitz-percentage 100))) (karl-net (* net-receipts (/ karl-percentage 100))) ) (save-excursion (set-buffer buf) (delete-region (point-min) (point-max)) (insert "\nThat's some mighty fine gravy there, Maw:\n\n") (insert (format " Lefty: $%d\n Fitz: $%d\n Karl: $%d\n" lefty-net fitz-net karl-net))) (display-buffer buf)))