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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started