Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a class that performs math operations on elements in an array of type doub

ID: 3658281 • Letter: W

Question

Write a class that performs math operations on elements in an array of type double and size 10. a.The constructor will accept as input an array of double. (in your parameter it should say double[] name) b.There should be a method the will return the difference between the largest and the smallest elements in the array of doubles. c.There should be another method that returns the sum of all the elements. d. Write another method that returns the number of elements above a value read in from the user in the tester class. You should send an explicit parameter to the method and compare each element in the array to this value. There should also be a tester class that asked the user to input 10 values and put them in an array. The tester class should create an object of the math operations class and call each of the methods. The tester class should print all the values returned from the methods. Redo the above problem but use Array Lists instead.

Explanation / Answer

import java.util.Scanner; import java.util.ArrayList; public class ArryMathOps_2Tester { public static void main(String[] args) { ArrayList arry1 = new ArrayList(); Scanner input = new Scanner(System.in); for (int i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote