Help,pls


#1


#2

hi @ajaxplayer53654
there in your code..
Its just city not city_name
same way state not state_name


#3

this worked for me, new input in bold, i also combined the two final lines of each bunch (gets.chop + .capitalize!)

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

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

print "What city are you from?"
city = Richmond
city = gets.chomp.capitalize!

print "What state or province are you from?"
state = California
state = gets.chomp.upcase!

puts "Your name is #{first_name} #{last_name} and you're from #{city}, #{state}!"


#4

ok, forget that last bit of info.

this is what rcodeman told me:

Delete all the bold line

keep the code what it was before

now when you'll run your code you have to type something in the console.for example

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

If you run this code first you'll see it prints What's your first name? in the console.
so type your name and then press enter in the console.
the first_name variable will store the value what you'll type.
I added the last line of code to print the value of first_name .


#5

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