Question: use java program [10 pts) Write a method called checkArrays that accepts as parameters two arrays of integer (A and B of the same size)

use java program
use java program [10 pts) Write a method called checkArrays that accepts

[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: A 1220 4 30 17 B 3 6 24 15 9 1 0 0 1 0 Use the following method header: public static int[] checkArrays (int[] A, int[ 1 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 (array A 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 arrayA and arrayB. Invoke the method printArray to display the values of the new array (array). Sample Run: ArrayA: 12 ArrayB: 3 ArrayC: 1 20 6 17 Oo 4 24 0 30 15 1 9 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!