In today's "student" directory, write a short Ruby program that tracks all the things Phil does while his son, Jim-Kevin, sleeps.
- Create a Ruby file,
while_the_cradle_rocks.rbwithin today's "student" directory. - Within
while_the_cradle_rocks.rb, create a variable,jim_kevin_is_sleepingand assign it the Boolean value oftrue - Create a variable,
phils_accomplishmentsand assign it an empty string"" - Create a while loop that will run as long as Jim-Kevin is sleeping.
- As long as Jim-Kevin sleeps, ask Phil what errand he runs. Use string concatenation to add it to the end of the
phils_accomplishmentsstring, along with a comma and a space, as this should print as a string. - Just before the end of the while loop, ask Phil if Jim-Kevin is still sleeping. Depending on her answer, assign
jim_kevin_is_sleepingto either true or false. - After Jim-Kevin wakes up, print the value of
phils_accomplishmentsto the console.
Make it print in a sensible manner.
Example: While the Cradle Rocked, Phil built up his knowledge in Ruby, took a nap himself, and went to the corner grocery.