Question: coding Ruby 1. The following codeblock has an error in it. Fix it so it prints The answer to the ultimate question of life, the

coding Ruby

1. The following codeblock has an error in it. Fix it so it prints "The answer to the ultimate question of life, the universe, and everything is 42" on the screen.

puts 'i'm using Ruby!'"

2. The following codeblock has an error in it. Fix it so it prints "The answer to the ultimate question of life, the universe, and everything is 42" on the screen.

answer = 42 puts "The answer to the ultimate question of life, the universe, and everything is " + "answer"

3.Keeping in mind there are 86400 seconds in a day, write a program that calculates how many seconds there are in a week, if a week is 7 days. Print the result on the screen.

4.What does the Ruby expression 7 * 10 + 2 evaluate to?

5.What does the Ruby expression "Hello" + "World!" evaluate to?

6.What does the Ruby expression 10 % 10 evaluate to?

7.What does the Ruby expression (2**2) == 4 evaluate to?

8.Keeping in mind order of precedence, what does the following expression evaluate to? 1 < 2 || 5 > 4 && 7 <= 7

9.What does the boolean expression !false && true evaluate to?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!