...

/

Exercise 1: Playing with Numbers

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!

widget

Try it yourself

Press + to interact
def playing_with_numbers(hours_in_year, minutes_in_decade, age)
age_in_seconds = 0
# Write - Your - Code
return hours_in_year, minutes_in_decade, age_in_seconds
end

Access this course and 1200+ top-rated courses and projects.