Question: [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
[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: C[i] = 1 if B[i] divides A[i], otherwise CO - 0. For example: A12 20 4 3017 3 6 24 | 15 9 0 Use the following method header: public static intl checkArrays (int 1 A, int[ ) B) [5 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 statie void printArray (int arr) a . [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 printArray and pass to it the two arrays arrayA and arrayB. Invoke the method logicAnd, and then invoke the method printArray to display the values of the new array (arrayC), Sample Run: 17 ArrayA: 12 Array: Arrayce 210 5 0 30 25 ano 9 24 0 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
