Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java Object-Oriented Programming Assignment1 In this assignment, you should create a class named ArrayUtil with the following properties: - A public static method named reverse
java
Object-Oriented Programming Assignment1 In this assignment, you should create a class named "ArrayUtil" with the following properties: - A public static method named "reverse" takes an array of integers as an argument and returns a new array with the elements in reverse order - A public static method named "sum" takes an array of integers as an argument and returns their sum - A public static method named "average" takes an array of doubles as an argument and returns their average - A public static method named "max" takes an array of integers as an argument and returns the maximum value in the array - A public static method named "copyArray" takes an array of integers as an argument and returns a copy of the array (use built-in system copying array) - A public static generic method named "printArray" takes an array of objects as an argument and prints each element in the array Create a second class named "ArrayProcessor" with the following properties: - A private field named "intArray" is an Arraylist of Integers - A public method named "readArray" uses an input dialog box to prompt the user for a series of integers until the user enters a non-integer value. Each integer entered should be added to the intArray field. - A public method named "processArray" uses the methods of Arrayutil to do the following: Reverse the intArray and store the result in a new array Print the sum, average, and maximum value of the intArray using the methods of ArrayUtil Generate a random number between 1 and 100 using the Random class of the Math library and print it - Copy the intArray using the copyArray method of ArrayUtil and print the copy - Use the printArray method of ArrayUtil to print the original intArray and the copy Create a third class named "Main" In the main method of the class, create an instance of ArrayProcessor and use its readArray and processArray methods to prompt the user for input and process the resulting array. Notes: - Use warrper clasees instead of primitive types. - Don't use built in methods (you must create all methods), you can only use builtin methods in Copying arrays. Random numbers generation 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