Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fav_destinations
- destination_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- 1.times do
- puts "Name a favorite travel destinantion."
- destination_array << gets.chomp
- end
- p destination_array
- puts "Your favorite travel destination is #{destination_array.join(", ")}."
- destination_array.each do |destination| # do something to each element in destination_array; that element is to be referred to as food
- puts "Travelling is so much fun! I like #{destination} too!" # the thing we are doing
- end # ends the loop
- end
- fav_destinations
- def fav_foods
- food_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- 1.times do
- puts "Name a favorite food."
- food_array << gets.chomp
- end
- p food_array
- puts "Your favorite food is #{food_array.join(", ")}."
- food_array.each do |food| # do something to each element in food_array; that element is to be referred to as food
- puts "Who does not like food? I like #{food} too!" # the thing we are doing
- end # ends the loop
- end
- fav_foods
- def fav_hobbys
- hobby_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- 1.times do
- puts "Name a favorite Hobby."
- hobby_array << gets.chomp
- end
- p hobby_array
- puts "Your favorite hobby is #{hobby_array.join(", ")}."
- hobby_array.each do |hobby| # do something to each element in hobby_array; that element is to be referred to as food
- puts "You can never have enough hobbies! I like #{hobby} too!" # the thing we are doing
- end # ends the loop
- end
- fav_hobbys
- def fav_colors
- color_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- 1.times do
- puts "Name a favorite color."
- color_array << gets.chomp
- end
- p color_array
- puts "Your favorite color is #{color_array.join(", ")}."
- color_array.each do |color| # do something to each element in color_array; that element is to be referred to as food
- puts "Interesting,I like #{color} too!" # the thing we are doing
- end # ends the loop
- end
- fav_colors
- def fav_songs
- song_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- 1.times do
- puts "Name a favorite Song."
- song_array << gets.chomp
- end
- p song_array
- puts "Your favorite song is #{song_array.join(", ")}."
- song_array.each do |song| # do something to each element in song_array; that element is to be referred to as food
- puts "Good to know, there are so many great songs! I like #{song} too!" # the thing we are doing
- end # ends the loop
- end
- fav_songs
- def fav_movies
- movie_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- 1.times do
- puts "Name a favorite Movie."
- movie_array << gets.chomp
- end
- p movie_array
- puts "Your favorite movie is #{movie_array.join(", ")}."
- movie_array.each do |movie| # do something to each element in movie_array; that element is to be referred to as food
- puts "Movies are so great! I like #{movie} too!" # the thing we are doing
- end # ends the loop
- end
- fav_movies
Add Comment
Please, Sign In to add comment