/*This assignment will give you practice using arrays. Create a class "IntVector" that contains a 1-dimensional array of integers. The class should include the following:
An instance variable that holds the integers. This will have to be an array variable. A constructor that takes an array of integer as a parameter, allowing you to set the contents of the object to an initial value. A "display" method which prints out the contents of the object. A "min" method which returns the minimum value in the object. A "mean" method which returns the average of all the integers stored in the object. A "sum" method which takes another IntVector as a parameter, and returns a new IntVector which is the element-wise sum of the two original objects. For example, if an IntVector object contains the integers { 4, 10, 7, 2 }, and you call "sum" passing as an argument another IntVector which contains { 1, 2, 3, 4 }, the result should be an IntVector which contains { 5, 12, 10, 6 }. This method will have to check to make sure the arrays in the invoking object and the parameter have the same length. (Hint: the "sum" method is the hardest part, so do this last.) Write a "main" method that tests each of the methods described above and demonstrates that they all work correctly. Remember to test the case where the length is zero. */
public class IntVector { public static void main(String[] args) { int[] numbers = { 4, 10, 7, 2 }; display( numbers );
} public static void display(int[] numbers) { int i; for( i = 0; i < numbers.length; i++ ) { System.out.println( numbers[ i ] ); } System.out.println( mean(numbers) );
} public static void min(int[] numbers) { for(int i = 0; i < numbers.length; i++ ) { if ( ) {
} }
} public static void mean(int[] num) { int sum=0; int mean; for(int i = 0; i < num.length; i++) { sum += num;