Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 falseStep 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