Fill in the blank to complete the following method that takes an array of integers and returns the average as a double: public static double getAverage(int[] array) { double avg = 0; for (. avg + array[i]; avg /- array.length; return avg;

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter6: Using Arrays
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question
Fill in the blank to complete the following method that takes an
array of integers and returns the average as a double:
public static double getAverage (int[] array) {
double avg = 0;
for (-
avg + array[1];
avg /- array.length;
return avg;
Transcribed Image Text:Fill in the blank to complete the following method that takes an array of integers and returns the average as a double: public static double getAverage (int[] array) { double avg = 0; for (- avg + array[1]; avg /- array.length; return avg;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,