Menu

(Solved) : Final Exam Version 1 5 5 120 Pts Write Method Called Logicand Accepts Parameters Two Array Q29708912 . . .

Java
Final Exam- version 1 5/5: 120 pts] Write a method called logicand that accepts as parameters two arrays o another array of integer (C) as follows: c14) -1 if B[i) divides A(il, otherwise CtA) integer (A and B) and returns 0 Example: 20 6 24 ? 1010110 Use the following method header public static intlJ logicAnd (intl 1 A, intl 1 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( intl 1) c- Use the above 2 methods in writing a test program (main) as follows: Declare and initialize 2 integer arrays (Arrayà 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 Invoke the method logicAnd Invoke the method printArray to display the values of the new array (Arrayc) arrays. Sample Run: ArrayA : 12 20 430 17 ArrayB:3 6 24 15 9 ArrayC :1 0 0 1 0Final Exam- version 1 5/5: 120 pts] Write a method called logicand that accepts as parameters two arrays o another array of integer (C) as follows: c14) -1 if B[i) divides A(il, otherwise CtA) integer (A and B) and returns 0 Example: 20 6 24 ? 1010110 Use the following method header public static intlJ logicAnd (intl 1 A, intl 1 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( intl 1) c- Use the above 2 methods in writing a test program (main) as follows: Declare and initialize 2 integer arrays (Arrayà 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 Invoke the method logicAnd Invoke the method printArray to display the values of the new array (Arrayc) arrays. Sample Run: ArrayA : 12 20 430 17 ArrayB:3 6 24 15 9 ArrayC :1 0 0 1 0 Show transcribed image text

Expert Answer


Answer to Final Exam Version 1 5 5 120 Pts Write Method Called Logicand Accepts Parameters Two Array Q29708912 . . .

OR