Write a method called average that computes the average (arithmetic mean) of all elements in an array
Question:
Write a method called average that computes the average (arithmetic mean) of all elements in an array of integers and returns the answer as a double . For example, if the array passed contains the values [1, – 2, 4, –4, 9, –6, 16, –8, 25, –10], the calculated average should be 2.5. Your method accepts an array of integers as its parameter and returns the average.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: