Question: this question please PART 2 Problem #3: [25 pts) Arrays and Methods . [10 pts) Write a method called checkArrays that accepts as parameters two

this question please
this question please PART 2 Problem #3: [25 pts) Arrays and Methods

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: C[i] = 1 if B[i] divides A[i], otherwise C[i] = 0. For example: A 12 20 4 30 17 B 3 6 24 15 9 c 1 0 0 1 0 Use the following method header: public static int[] checkArrays (int[] 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 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 logicAnd and pass to it the two arrays arrayA and arrayB. Invoke the method printArray to display the values of the new array (arrayC). Sample Run: 20 17 ArrayA: 12 ArrayB: 3 ArrayC: 1 01 N 4 24 30 15 no 9 6 0 ON 1 0

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!