class Rabbit @@count=0 attr_accessor :age def initialize @age=0 @@count+=1 end def increment @age+=1 end def self.quantity @@count end end first_rabbit=Rabbit.new rabbits=Array.new rabbits<<first_rabit puts "Input the months:" n=gets.chomp.to_i n.times do |month| puts "#{month} -- #{Rabbit.quantity*2} rabbits" rabits.each do |rabbit| rabbit.increment if rabbit.age>=3 rabbits<<Rabit.new end end end