#Sales Offer!| Get upto 25% Off:

Integer Array Class This assignment asks you to write a collection of littlefunctions that all operate on an array of integers. In your main, declare and initialize two literal integer arraysin main(), called sampleArray1 and sampleArray2 with the followingvalues: int[] sampleArray1 = {4,7,9,3,2,8,15,6,8,7}; int[]sampleArray2 = {12,6,4,8,3,7,11,1,6}; You will use these arrays fortesting your functions later on. Implement a class called IntegerArray. In your main function, create one or more arrays and call eachof the following methods as you implement them. For methods thatreturn a value, the code in main() should print the result of thecall. In the IntegerArray class, only the printLiteral methodshould include calls to System.out. In each of these methods, you need to pass in the array as theargument. 1. Create a function called printLiteral that prints the arrayto the console in a form that looks exactly like the literalstrings use above for initialization. The literal starts with a“{“, then lists the numbers separated by commas but no spaces, andending with “}”. The output must even work if the length of thearray is 0 (“{}”) or 1 (no commas). 2. Create a function called sumOfArray that returns the sum ofthe values in the array. 3. Create a function called maxInArray that returns the maximumvalue in the array. 4. Create a function called minInArray that returns the minimumvalue in the array. When looking for min or max, compare each new value to the minor max value that you have seen so far. Do not initialize thatvalue to an arbitrary extreme (like 0). Observe that when you checkthe first value of the array, that value should become the min ormax you have seen so far, since you haven’t seen anything else.Assuming that you are using a variable called minSeen, the correctsolution is to initialize minSeen to the first value right away,before starting the loop. That way you don’t have to know anythingabout the range of possible values (which could be all negative,making 0 a bad choice for the initial value.) 5. Create a function called rangeInArray that returns the rangeof the values in the array. In math, the range is the magnitude ofthe difference between the minimum and maximum (inclusive). Youcompute it by subtracting the minimum from the maximum. You alreadyhave methods that return the min and max. Use them and do notinclude any loops in this method. If Array is empty, The min and max methods should just return0. . . .

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!