Search⌘ K
AI Features

Exercise 1: Playing with Numbers

Explore Ruby's built-in Numeric class by solving practical problems involving integers and floats. Learn how to apply numeric operations and calculate time units, such as hours and minutes in December, to strengthen your Ruby programming skills.

We'll cover the following...

Problem statement

How many hours and minutes are there in the month of December?

Tip: Start writing your code from line 3 below without worrying about the enclosing lines of code.

Try it yourself

Ruby
def playing_with_numbers
hours_in_december = -99, minutes_in_december = -99
# Start your code here
return hours_in_december, minutes_in_december
end