Question: Q1: a- Write a method called logicAnd that accepts as parameters two arrays of integer (A and B) and returns another array of integer (C)

 Q1: a- Write a method called logicAnd that accepts as parameters

Q1: a- Write a method called logicAnd that accepts as parameters two arrays of integer (A and B) and returns another array of integer (C) as follows: C[i] = 1 if B[i] divides A[i], otherwise C[i] = 0. Example: A 12 20 4 30 17 B 3 6 24 15 9 C10010 Use the following method header: public static int[] logicAnd(int[] A, int[] B) b- 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[]) C- Use the above 2 methods in writing a test program (main) as follows: - Declare and initialize 2 integer arrays (ArrayA and ArrayB) of size 10 (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 - Invoke the method printArray to display the values of the new array (Array)

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!