Created
February 8, 2013 17:10
-
-
Save CiaraBurkett/4740430 to your computer and use it in GitHub Desktop.
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
# Time is on my side | |
def seconds_in_minutes(int) | |
int * 60 | |
end | |
def minutes_in_hours(int) | |
int * 60 | |
end | |
def hours_in_days(int) | |
int * 24 | |
end | |
def days_in_weeks(int) | |
int * 7 | |
end | |
def weeks_in_years(int) | |
int * 52 | |
end | |
def age_from_seconds(int) | |
int / (60*60*24*365) | |
end | |
hours_in_year = hours_in_days(365) | |
minutes_in_decade = hours_in_year * 60 | |
seconds_in_year = (hours_in_year * 60) * 60 | |
age_in_seconds = seconds_in_year * 26 | |
puts "There are #{hours_in_year} hours in a year." | |
puts "There are #{minutes_in_decade} minutes in a decade." | |
puts "Ciara is #{age_in_seconds} seconds old." | |
puts "If I am 1,111 million seconds old, I am #{age_from_seconds(1111000000)} years old." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment