Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created July 10, 2016 19:51
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 anonymous/215dbc09769af1c606d709bd47a9ee33 to your computer and use it in GitHub Desktop.
Save anonymous/215dbc09769af1c606d709bd47a9ee33 to your computer and use it in GitHub Desktop.
hours_in_year = 24 * 365
minutes_in_decade = (hours_in_year * 10) * 60
seconds_in_year = 365 * 24 * 60 * 60
puts "There are " + hours_in_year.to_s + " hours in a year."
puts "There are " + minutes_in_decade.to_s + " minutes in a decade."
puts "How old are you?"
age_in_years = gets.chomp
age_in_seconds = age_in_years * seconds_in_year
puts "You are " + age_in_years.to_s + " years old, which means that you have been alive for approximately " + age_in_seconds.to_s + " seconds."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment