Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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 submit

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

Step: 3

blur-text-image

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

ISBN: 0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

3. What are potential solutions?

Answered: 1 week ago