Question: Ruby Example Output: Enter 5 numbers: Average: 3.0 Help, I can't get the sum from the input array so I can get calculate the average.

 Ruby Example Output: Enter 5 numbers: Average: 3.0 Help, I can't

Ruby

Example Output: Enter 5 numbers: Average: 3.0

Help, I can't get the sum from the input array so I can get calculate the average.

saved back to classroom numbers = [] puts "Enter 5 numbers:" 5.times do Ixl numbers [x] gets. chomp end sum 0 number.each do Ix, suml sum+X puts sum end linux]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!