Question: Method name: positiveAverage Parameter ( s ) : an int array Return value: the average of the positive items in the array as a double

Method name: positiveAverage
Parameter(s): an int array
Return value: the average of the positive items in the array as a double value
Example: positiveAverage(new int[]{2,3,4}) should return 3.0
Note 1: A positive integer is greater than zero.
Note 2: You may assume that the array contains at least one positive integer, which avoids the need to check for a divide-by-zero error.

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!