When running the chomp method for the full name greeting, I get an undefined method or uninitialized error. Is there an extra step involved that causes the f_name, m_name, and l_name to be completed.
Can you post your code that is having problems, as well as posting the error message? Otherwise, I really have no idea what’s not working for you. :-)
I’ll type in:
puts ‘What is your first name?’ f_name = gets.chomp puts “What is your last name?’ l_name = gets.chomp
full_name = f_name + l_name
puts ‘Hello, ‘ + full_name + ‘!’
Then, when I choose run it leads to Error: File calc.rb; Line 39 on text editor: in ‘': undefined method 'chomp' for nil:Nil Class (no method error)
That error says “Line 39”, but you only posted a few lines of code. Try putting only the code for this program in a separate file and running it. See if that helps.
So I typed out the code in a separate file in the text editor and it gives me a notification which states that the file doesn’t appear to contain a valid ‘shebang’ line. Could it be that I didn’t save it properly?