title: Array not saving user input in ruby
body: <p>This is what I have so far, but the array is not saving the first value if the user enters 2 or more car types. If I remove the car.get_ methods the program runs fine without saving the users input. Is there a method I am missing?</p>
  
  <pre><code>class Cars
  
      def set_make(make)
      end
  
      def set_model(model)
      end
  
      def set_year(year)
      end
  
      array_of_cars = Array.new 
  
    print "How many cars do you want to create? "
    num_cars = gets.to_i
    puts 
  
    for i in 1.. num_cars
      puts
      print "Enter make for car #{i}: "
      make = gets.chomp
  
      print "Enter model for car #{i}: "
      model = gets.chomp
  
      print "Enter year of car #{i}: "
      year = gets.to_i
  
      c = Car.new
  
      c.set_make(make)
      c.set_model(model)
      c.set_year(year)
  
      array_of_cars &lt;&lt; c
    end 
  
      puts
      puts "You have the following cars: " 
  
    for car in array_of_cars 
      print "#{car.get_year} #{car.get_make} #{car.get_model}"
    end
  end
  </code></pre>