Question: //use Java and no arraylist public class Utilities { /* /* Input parameters: numbers : an array of integers public static int[] getMultiplesOf3(int[] numbers) {

 //use Java and no arraylist public class Utilities { /* /*

//use Java and no arraylist

public class Utilities { /* /* Input parameters: numbers : an array of integers public static int[] getMultiplesOf3(int[] numbers) { int[] result = null; return result; }

2.2.1 Method to Implement: getMultiplesOf3 Problem. You are asked to implement a utility method which takes as input an array of integers and returns another array containing all those elements that are multiples of 3. For example, if the input array is: Then the output or returned array is: Note that the length of the output array corresponds the number of elements in the input array that are multiples of 3, meaning that if the input array is empty, or if there are no multiples of 3 in the input array, then the output array should be empty. Also, the output array should preserve the order in which these multiples, if any, appear in the input array. For example, in the above example, multiples of 3 in the input array appear in the order of 6 followed by 3, which is reflected in the output array. Testing. Your goal is to first pass all tests related to this method in the JUnit test class TestUtilities. You are encouraged to write additional JUnit tests. These tests document the expected values on various cases: study them while developing your code. However, use the console application class GetMultiplesOf3App if you wish (e.g., use the input and expected values from the JUnit tests). Here is an example run: How many numbers do you want to input? 10 Enter input 1: 89 Enter input 2: 23 Enter input 3: 42 Enter input 4: 87 Enter input 5: 18 Enter input 6: 36 Enter input 7: 23 Enter input 8: 97 Enter input 9: 102 Enter input 10: 987 Todo. Implement the Utilities.getMultiplesOf3 method. See the comments there for the input parameters and requirements

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!