courses, credits and points are Ruby arrays with an equal size.
gpa = (([credits, courses, points].transpose.map {|x| x.reduce(:*)}).inject{|sum,x| sum + x }).round(2)
This method prompted an error message when I was trying to run it.
Error message:
in 'each': undefined method '*' for nil:NilClass (NoMethodError)