Question: Part 1. Create a Java program with the following methods with integer arrays: Array ar with 12 integer numbers a) arRandom to fill in an

Part 1.

Create a Java program with the following methods with integer arrays:

Array ar with 12 integer numbers

a) arRandom to fill in an array with integer numbers from start to end numbers

Inside the method program the case if the user put the start number bigger than end number. (Swap them before populating the array with random numbers).

b) arPrint to print an array in a row

c) arAverage to print the average of an array

d) arMin - to find and return min element in an array

e) arSearch to output if a number is in an array 0r not

Before creating the methods please analyze which type of method to write (void or method that returns a value), number of all parameters and their types. Create a method header for each method.

In the main method: declare an array ar with 12 int elements. Ask the user for start and end numbers. Use methods above to populate the array and print it. Then find and output min element.

Ask the user for a number to search and call the method arSearch.

Part 2 .(In the same program)Create a method arMerge with 3 int array parameters a, b and c. Method should populate the array c with numbers: first part from array a, second part -> from b. In the main method create one array a with 9 elements and put their random integers from 10 to 50. Then create the array b with 6 int elements from 1 to 8. Declare the array c with 15 int elements. Call method arMerge and then print all 3 arrays by calling 3 times arPrint method.

Put the header for your program and put the appropriate headers for each method. Submit your work by Google Classroom.

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!