Where do I input my answers?


#1

Would anyone be able to tell me where I am supposed to input my answer before I run the code? For example, where should I type my first name? Thanks in advance for your help!

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 city are you from? "
city = gets.chomp
city.capitalize!

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

puts “Your name is #{first_name} #{last_name} and you’re from #{city}, #{state}!”


#2

you shouldn’t? Run the code/program, while the program is running gets.chomp will prompt you for input


#3
  1. Run the code.
  2. Computer will ask you for the input
  3. input

#4

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