Im trying to store all of User's input into a hash and then loop through the hash and display results. Input: First name, Last Name, Age, City Visited(user will input multiple cities until they input "exit".
Here's what I got so far..and everything looks good except being able to separate the cities as multiple Values when multiple cities are entered.
result = ""
print "Enter first name "
first = gets.chomp
print "Enter last name "
last = gets.chomp
print "Enter age "
age = gets.chomp
while TRUE
print "Enter city"
city = gets.chomp
if city == "exit"
break
end
result = result + " " + city
end
user_data = { first: first, last: last, age: age, city: result}
puts "#{user_data}"