Ad

Code a function that will return the exact average grade of an array of grades. Grades can be integer or float numbers.

Code
Diff
  • def average(grades)
      grades.sum.fdiv(grades.length)
    end 
    • def average (grades)
    • grade.sum/grade.length
    • def average(grades)
    • grades.sum.fdiv(grades.length)
    • end