Question
The loop below stores the values 1 to 5 in myList: for (int i = 0; i < 5; i ++) { myList [ i
The loop below stores the values 1 to 5 in myList:
for (int i = 0; i < 5; i ++) {
myList [ i ] = i + 1; //store values using a loop
}
The loop below prints the values from first to last in myList:
for (int i = 0; i < myList.length; i++) {
System.out.print(myList [ i ] + " ");
}
Use the examples on the slides to complete the lab below. Please submit the Java program (XXXX_Lab71) and a screen print of the Eclipse editor showing your code and output with answers:
The class will do the following:
1) Consist of five methods:
a. main
b. public int [] fillArray()
c. public void printArray(int [] list)
d. public int findAverage(int [] list)
e. public void printHigherThanAverage(int [] list, int average)
2) The main method will call all the other methods
3) The fillArray method will create the array, ask the user for 5 values, store the values in the array and return the array.
4) The printArray method will print the array
5) The findAverage method will find the average of the elements in the arra
6) The printHigherThanAverage method will print all the numbers greater than the average.
need help writing the code in java using eclipse.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started