Question
Using java write a method called logic and that accepts as parameters two arrays of integer (A and B) and returns another array of integer
Using java write a method called logic and that accepts as parameters two arrays of integer (A and B) and returns another array of integer (C). C[i] = 1 if B[i] divides A[i], otherwise C[i]=0. Write a test program (main) to declare and initialize two integer arrays of size entered by the user, invoke the method logicAnd, then display the array result. The program put the three arrays (A, B and C) in a 2-D array M as follow. Sample Run: Enter the size of the array: 5 Enter 5 numbers for A: 12 20 4 30 17 Enter 5 numbers for B: 3 6 24 15 9 The results: A 12 20 4 30 17
B 3 6 24 15 9
C 1 0 0 1 0
M 12 20 4 30 17
3 6 24 15 9
1 0 0 1 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started