Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the code should be in java and i really need it fast Problem #3: (25 pts] Arrays and Methods [10 pts) Write a method called

the code should be in java and i really need it fast
image text in transcribed
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: Cli] = 1 if B[i] divides A[i], otherwise C[i] = 0. For example: A 12 20 4 30 17 10 B 3 6 24 15 9 c1|010 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 checkArrays 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: ArrayA: 12 ArrayB: 3 ArrayC: 1 20 6 0 4 24 30 15 1 ON 17 9 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions