Skip to content

Instantly share code, notes, and snippets.

@ismyrnow
Created July 22, 2022 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismyrnow/2582a99e4b99b1e13b9593426fd55e86 to your computer and use it in GitHub Desktop.
Save ismyrnow/2582a99e4b99b1e13b9593426fd55e86 to your computer and use it in GitHub Desktop.
When would you like to retire? IN CLOJURE!!!
(do
(print "How old are you? ")
(def currentAge (Integer/parseInt (read-line)))
(flush)
(println currentAge)
(print "At what age would you like to retire?")
(flush)
(def retirementAge (Integer/parseInt (read-line)))
(println retirementAge)
(def yearsToRetirement (- retirementAge currentAge))
(def currentYear (.getYear (java.time.LocalDate/now)))
(println "You have" yearsToRetirement "years left until you can retire.")
(println (format "It's %s, so you can retire in %s" currentYear (+ currentYear yearsToRetirement))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment