Seems like a lot of folks are having trouble with this one


#1

Can't get past this one. What am I missing?

print "What's your first name?" 
first_name=gets.chomp
first_name2=answer.capitalize
answer.capitalize!
print "What's your last name?"
last_name=gets.chomp
last_name2=answer.capitalize
answer.capitalize!
print "What's your city?"
city=gets.chomp
city=answer.capitalize
answer.capitalize!
print="What's your state?"
state=gets.chomp
state=answer.capitalize
answer.capitalize!
.upcase


#2


#3

Should that be, answer = gets.chomp?

Likewise through the remaining inputs.

This line isn't doing anything...

You are clouding the issue with so many variables. Don't make that an addiction or your code will be a nightmare for others to read. Ruby makes it very easy for us to write simple 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?"
city = gets.chomp.capitalize

print "What's your state?"
state = gets.chomp.upcase

#4

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