Created
July 22, 2022 01:34
-
-
Save ismyrnow/2582a99e4b99b1e13b9593426fd55e86 to your computer and use it in GitHub Desktop.
When would you like to retire? IN CLOJURE!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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