I'm stuck in Putting the Form in Formatter please help!



I have a problem with the Form in Formatter, and I can't find where the problem is. Can anyone help me please? It tels me that I didn't print anything but I did. I get the error: (ruby):2: syntax error, unexpected tIDEN TIFIER, expecting $end
Thank You!
Here is my code:

print "What's your first name?"
first_name = gets.chomp.capitalize!
print "What's your last name?"˘
last_name = gets.chomp.capitalize!
print "What's your city name?"
city = gets.chomp.capitalize!
print "What's contry name?"
state = gets.chomp.upcase!
print "your name is #{first_name} #{last_name}! You are from #{city}, #{state}"


Data input is less treated like an interrogation and more like directed activity, and we would never use such informal diction and contractions when addressing people we don't know. If the context is known to the user, then the inputs will be direct...

    print "First name: "
    print "Last name : "
    print "City      : "
    print "State     : "

This line raises an eyebrow...

Considering it is declared in the previous statement, declaring it again could result in nil since no change will be made and ! causes it to register the outcome. last_name vaporizes.


Thank You for your answer!
I was just practicing Ruby so i shorted the questions. I try just mastering the basics.

The last_ name.capitalize! line is an error thank you, it was a remaining line from early attempt to get the code right. I deleted, but I got the same error.

So I erased my entire code and have writen again and then it works.
So anyway thank you for your efforts.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.