I am trying to create a program in ruby where in users will be able to continually add an item and it will continually show up the contents of the array until the word "EXIT" was submitted.
I also trying to figure it out how can I add a program where in I can remove the specific item name using array.pop[] on the list but the program still works.
Here's what I got so far:
array = []
puts "WELCOME TO THIS PROGRAM"
puts "You can add any item as much as you want. Type EXIT if you want to STOP!"
print "Add a new item: "
user_input = gets.chomp
array.push user_input
puts "HERE ARE THE CONTENT OF THE ARRAY "
p(array)
while user_input != "EXIT"
puts "Add a new item: "
user_input = gets.chomp
array.push user_input
puts "HERE ARE THE CONTENT OF THE ARRAY "
p(array)
end
Any idea what my program is lacking?
user_input = nil.