How to make the code more responsive


#1

Ok, so i have finished the "Putting the form in Formatter" section in the Ruby course and i was wondering if anyone knows how i could make the code be more responsive as in, instead of having to put your own name in answer to the question. How would you be able to make the code work with any name, city etc. without the screen showing in my case, first_name = "Will", last_name = "Close", city = "Melbourne", state = "VIC" but whatever name that was put in the answer box.

This is my code at the moment:

`print "What's your first name?"
first_name = gets.chomp
first_name2 = first_name.capitalize
first_name.capitalize!

print "What's your last name?"
last_name = gets.chomp
last_name2 = last_name.capitalize
last_name.capitalize!

print "What city do you live in?"
city = gets.chomp
city2 = city.capitalize
city.capitalize!

print "What state or province do you live in? (abbreviation)"
state = gets.chomp
state2 = state.upcase
state.upcase!

first_name = "Will"

last_name = "Close"

city = "Melbourne"

state = "VIC"

print "Your name is #{first_name} #{last_name} and you live in #{city}, #{state}!"
`

Thanks :relaxed: :+1:


#2

If you take out all of those lines it should do what you are asking.

You might also want to think about what the point of these lines is:

first_name2 = first_name.capitalize