Question: Please code this problem in Java. Please only use arrays, for/while loops, and if statements and do not use any array lists. Also, please do

Please code this problem in Java. Please only use arrays, for/while loops, and if statements and do not use any array lists. Also, please do not code this in the main method and use a separate method as stated in the todo section of the picture.

Please code this problem in Java. Please only use arrays, for/while loops,

2.2.4 Method to Implement: getGroupedNumbers Problem. You are asked to implement a utility method which takes as input an array of integers and returns another array grouping all elements from the input array as follows, from left to right: 1) elements divisible by 3; 2) elements divided by 3 with the remainder 1; and 3) elements divided by 3 with the remainder 2. For example, if the input array is: Then the output or returned array is: (6, 3:41, 2,5 Group 1 Group 2 Group 3 Note that the input and output arrays are equally long, meaning that if the input array is empty, then the output array should be empty. Also, each group of the output array should preserve the order in which its elements appear in the input array. For example, in the above example, Group 2 of the output array (i.e., those divided by 3 with the remainder 1) contains 4 followed by 1, reflecting their order in the input 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 GetGroupedNumbersApp 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: 22 Enter input 3: 42 Enter input 4: 87 Enter input 5: 19 Enter input 6: 36 Enter input 7: 23 Enter input 8: 97 Enter input 9: 102 Enter input 10: 987 Todo. Implement the Utilities.getGroupedNumbers 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!