Question: PART 2 Problem #3: (25 pts) Arrays and Methods [10 pts) Write a method called checkArrays that accepts as parameters two arrays of integer (A

PART 2 Problem #3: (25 pts) Arrays and Methods [10 pts) Write a method called checkArrays that accepts as parameters two arrays of integer (A and B of the same size) and returns another array of integers (C) initialized as follows: Cli] = 1 if B[i] divides A[i], otherwise C[i] = 0. For example: 20 3D 362415 9 Do Use the following method header public static intcheckArraya (int 1 A, int B) 15 pts) Write a void method called printArray that accepts as parameters an array of integers and print its values. Use the following method header: public static void printArray (int arr) [10 pts] Write a main method to test the above methods as follows: Declare and initialize 2 integer arrays (arrayA and arrayB) of size 5 (fill the 2 arrays with random integers between 1 and 100). Invoke the method printArray to display the values stored in the two arrays. - Invoke the method checkArrays and pass to it the two arrays array and arrayB. Invoke the method printArray to display the values of the new array(arrayC). Sample Run: ArrayA: 12 ArrayB: 3 ArrayC: 1 20 6 4 24 0 30 15 1 17 9 0 o
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
