Question
JAVA Write a void method called noEvens. noEvens should take an int array as a parameter, and delete all even numbers in the array. Shift
JAVA Write a void method called noEvens. noEvens should take an int array as a parameter, and delete all even numbers in the array. Shift the values such that the lower part of the array is all odd numbers. EX: initial array {2, 3, 4, 5, 0} array after the call {3, 5, 0, 0, 0} Test this method from main by calling it with these arrays: {2, 2, 2, 2, 2, 2, 2, 2, 2, 0} { 1, 2, 3, 4, 5, 6, 7, 8, 0 } { 1, 2, 4, 4, 5, 6, 7, 8, 0 } { 2, 2, 4, 4, 2, 6, 6, 8, 0 } { 1, 3, 5, 7, 9, 11, 13, 15, 0 } Use printArray that you wrote earlier to print out the array to make sure it worked. Leave your test code in main when you submit
Picture:
1. 5 pts. Write a void method called noEvens. noEvens should take an int array as a parameter, and delete all even numbers in the array. Shift the values such that the lower part of the array is all odd numbers. EX: initial array {2, 3, 4, 5, 0} array after the call {3,5, 0, 0, 0} Test this method from main by calling it with these arrays: {2, 2, 2, 2, 2, 2, 2, 2, 2, 0} {1, 2, 3, 4, 5, 6, 7, 8, 0} { 1, 2, 4, 4, 5, 6, 7, 8, 0} { 2, 2, 4, 4, 2, 6, 6, 8,0} { 1, 3, 5, 7, 9, 11, 13, 15, 0} Use printArray that you wrote earlier to print out the array to make sure it worked. Leave your test code in main when you submitStep 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