Question: Int Arrays Lab 2(java) ab 2 Write these methods related to arrays InitArray(int[l arr, int size): Inputs: an integer array, and an int representing the

 Int Arrays Lab 2(java) ab 2 Write these methods related to

arrays InitArray(int[l arr, int size): Inputs: an integer array, and an int

Int Arrays Lab 2(java)

ab 2 Write these methods related to arrays InitArray(int[l arr, int size): Inputs: an integer array, and an int representing the size of the array *Outputs: none (void) . This array initializes all elements of an array to zero. Use a while loop to Ex: InitArray(arr, 4);//arr should print as 0, 0, 0, 0 initialize all elements. PrintArray(intll arr, int size); Inputs: an ineger array, and an int representing the size of the array * Outputs: none (void) . This method prints all elements of the array. Print the elements of an array in a comma separated list shown below. After the array prints, you should also print a new line Ex: PrintArray(arr, 4); Output: 0, 0, 0, 0 . CompArray() Inputs: two integer arrays, and two ints representing the size of each array Outputs: Boolean (whether the two arrays were equal) *Compare the two input arrays. Return true if they were equal, return false if they were not equal. (Hint: writing arr1 Test the method arr2 does not check for equality) Ex: int size1 5; int size2 5 intll arrl [1, 2, 3, 4, 5]; intll arr2 [1, 2, 3, 3, 5]; boolean isEqual compArray(arri, arr2, size1, size2);//should return false

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!