Question: Need help to complete this; I got 9 . 0 9 out of 1 0 Write a program that calculates the average of a sequence

Need help to complete this; I got 9.09 out of 10
Write a program that calculates the average of a sequence of integer values entered by a user. The program must implement the following methods:
The method
| prompts the user to enter the total number of integer values he/she would like to enter. The method returns the count after it is entered.
been entered.
The method conputcaverage(int total, int count) computes and returns the average by dividing the total of all values entered by the number of values entered which is defined by the count parameter.
The methor hows a statement with the average value to the console.
Solution
program in an IDE and check that your answers compile as expected.
class Program [
public static void main(String... args){
int count = inputCount0:
int total =
int average = computeAverage (
showAverage(average):
J
static int inputCount()(
Scanner scanner = new Scanner(System.in);
System.out.println("How many values would you like to enter?");
int count =
1
static int inputValues(int count){
int total =0;
Scanner scanner = new Scanner(System.in);
for (int i=1;quad i quad i quad !
System.out.println("Enter "+ i +";
int value = scanner.nextint(0:
1
J
stati
computeAverage(int total, int count)(
int avg =
return avg:
1
static
showAverage (
int average
11
System.out.println("Average: "+ average);
)
1
Need help to complete this; I got 9 . 0 9 out of

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 Programming Questions!