Exercise 1: Playing with Numbers
Ready for a time calculation exercise?
Problem Statement
In the exercise below, calculate:
- How many hours are in a year
- How many minutes are in a decade?
- How to convert an age given in years seconds
Remember, you need to indent your code in Ruby otherwise it will give a compilation error!
Try it yourself
Press + to interact
def playing_with_numbers(hours_in_year, minutes_in_decade, age)age_in_seconds = 0# Write - Your - Codereturn hours_in_year, minutes_in_decade, age_in_secondsend