6. Putting the Form in Formatter


#1

What is wrong here? It will not let me move forward.

My code is this:

print "What is your first name?"
first_name = gets.chomp
first_name2 = first_name.capitalize
first_name.capitalize! 
print "Mary"
print "What is your last name?"
last_name = gets.chomp
last_name2 = last_name.capitalize
last_name.capitalize! 
print "Smith"
print "What is your city?"
city = gets.chomp
city2 = city.capitalize
city.capitalize! 
print "New York"
print "What is your state?"
state = gets.chomp
state2 = state.capitalize
state.capitalize! 
print "NY"

Output is this:
What is your first name?
MaryWhat is your last name?
SmithWhat is your city?
New YorkWhat is your state?
NYnil


#2

Have a look at this:

Instead of that, you could just do:

first_name.capitalize!

And then instead of this:

Why not try:

print first_name

Then instead of working for just Mary, it will work for all of the people who run your program.


#3

Thank you albionsrefuge. It worked!


#4

Please help me

print "Whats your first name?"
first_name = gets.chomp
first_name.capitalize
print "Whats your last name?"
last_name = gets.chomp
last_name.capitalize
print"What city are you from?"
city = gets.chomp
city.capitalize
print "Which state or province are you from?"
state = gets.chomp
state.upcase
puts "Your name is #{first_name} #{last_name} and you are from #{city}, #{state}"


#5

Hi you just forgot the ! after capitalize and upcase


#6

Hi wizmarco,
this is my writing, but i can't figure out where the mistake is, please help me !!
print "What's your first name?"
first_name = gets.chomp
first_name.capitalize!
print "Where are you from?"
city = gets.chomp
city.capitalize!
puts "Your name is #{name}, you are from #{city}"


#7

HI it's missing last_name and state your code should be like that at the begin of the lesson

print "What's your first name?"
first_name = gets.chomp

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

print "which city are you_living?"
city = gets.chomp

print "where are you from?"
state = gets.chomp

then you should do what the lesson 6.Putting the Form in Formatter is asking you..


#8

Thank a lots Wizmarco !!


#10