Exercise: First steps
Write a program in Ruby to calculate the number of milliseconds in a day.
We'll cover the following
Problem statement
In the exercise below, try to write a program that calculates the number of milliseconds in one day. How should we approach this problem? How many hours are there in one day? How many minutes are there in one hour? How many seconds are there in one minute? How many milliseconds are there in one second?
Note: Remember, we need to indent our code in Ruby, otherwise it will give a compilation error.
Try it yourself
Get hands-on with 1400+ tech skills courses.