Fix the code Ruby to generate the output depicted below Here

Fix the code (Ruby) to generate the output depicted below:

Here\'s the code I have currently:

puts \"Enter your age:\"
gets age
print \'You have been living for \'
print Age*24*365*60*60
puts\' seconds!\'
puts \'WOW!\'

Enter your age: 27.75 ou have been living for 875124000.0 seconds! WOW!

Solution

Working code:

puts \"Enter your age:\"
a = gets.chomp
print \'You have been living for \'
c = a.to_i*24*365*60*60
print c
puts\' seconds!\'
puts \'WOW!\'

Fix the code (Ruby) to generate the output depicted below: Here\'s the code I have currently: puts \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site