Question: Task 1 : Create two arrays and fill them with values:a . Use the following statement to create array 1 and array 2 with these

Task 1: Create two arrays and fill them with values:a. Use the following statement to create array1 and array2 with these specific values:int[] array1={6,13,18,1,9,7,16,11,2};int[] array2={4,10,5,12,3,8,14}; b. Display the values in both arrays on consolec. Next move the values in the two arrays such that:i. All the even values are in array1, and all the odd values are in array2. ii. You must perform this task using ONLY the 2 given arrays.iii. No additional data structures are allowed, but extra variables can be used. d. Sort both arrays using the sort() method in the Arrays class.e. Display the values in both arrays to prove they are separated and sorted.f. See the MUST DO AND TIPS section for more details and allowed assumptions for the two arrays.

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 Programming Questions!