Advertisement
Crenox

Simple Program in Ruby w/ User Input

Nov 13th, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. print("What's your first name?")
  2. first_name = gets.chomp
  3. first_name.capitalize!
  4.  
  5. print("What's your last name?")
  6. last_name = gets.chomp
  7. last_name.capitalize!
  8.  
  9. print("What's your city name?")
  10. city = gets.chomp
  11. city.capitalize!
  12.  
  13. print("What's your state or province name?")
  14. state = gets.chomp
  15. state.upcase!
  16.  
  17. sentence = "My name is #{first_name} #{last_name}, and I live in #{city}, #{state}!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement