6/7 It is printing correctly, but won't move forward


#1

Okay so I figure I must not be following the directions... But, here is my code:

print("What's your first name?")
first_name= gets.chomp
print("What's your last name?")
last_name= gets.chomp
print("What's your city?")
city= gets.chomp
print("What's your state?")
state= gets.chomp
puts "Your name is #{first_name.capitalize} #{last_name.capitalize}. You live in #{city.capitalize},#{state.upcase}"

This prints perfectly fine, why am I getting this message? :
Oops, try again.
Make sure to call capitalize! on first_name, last_name, and city.


#2

LOL I keep asking questions...and then keep figuring out the answer...

So It's just picky I presume... but please let me know if the way I did this initially would or would not work in a more complex program.

I feel like the way I initially coded it, would be more efficient...(i'm just kind of about typing less, and getting more out of it if possible)

What do you think?

print("What's your first name?")
first_name= gets.chomp
first_name.capitalize!
print("What's your last name?")
last_name= gets.chomp
last_name.capitalize!
print("What's your city?")
city= gets.chomp
city.capitalize!
print("What's your state?")
state= gets.chomp
state.upcase!
puts "Your name is #{first_name} #{last_name}. You live in #{city},#{state}"

#3

We can find answers only by asking questions :smile:.


#4

Never mind. I got it. You should probably have a comment in the instructions saying that the result will be that the active window (or whatever you're calling it) will be that the program prints the first string, then WANTS YOU TO INPUT THE ANSWER before it continues.

And when you have answered ALL the questions in the various strings, THEN you will get the pass on the question.


#5

I think they explained that back in exercise 1, or did you just skip ahead and jump into exercise 6?

Answer each question, and hit enter (return on some keyboards).


#6

already got it. thank you.


#7

Good work, and you're welcome.