Im trying to make this program using Ruby but Im messing som
I\'m trying to make this program using Ruby, but I\'m messing something up in the code.
The “name” program will input/output depicted below:
Here\'s the code that I have:
puts
puts \"what\'s Your Name?\"
name=gets.chomp
if name ==\"\"
puts \"Try again\"
elsif name==\"Mary\"
puts \"Hello Mary!\"
else puts \"Try something else\"
end
Solution
puts \"what\'s Your Name?\"
name=gets.chomp //This removes the newline character
if name == \' \' //Here single quotes will go
puts \"Try again\"
elsif name==\"Mary\"
puts \"Hello Mary!\"
else puts \"Try something else\"
end
