Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

=+5. How satisfied is organizational leadership with this quality?

Answered: 1 week ago