Now implement the removeOdd method in Java. Can only edit code in the /* Your code goes here */ portion.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Now implement the removeOdd method in Java. Can only edit code in the /* Your code goes here */ portion.
0 src e RemoveTester
m main
roject
C PrintDemo.java X
e PasswordGenerator.java x
G
IntegerName.java x
C Grades.java
test.java x
C ArrayDemo,java x
x
© Num
cSC 1350 -/ldeaProjects/CSC 1350
import java.util.Arrays;
1
.idea
2
out
3 >
public class RemoveTester
src
C ArrayDemo
C Boxes
e Compare2
e Cubes
e DoLoop
© Doublelnvestment2
C DuplicatedCharacters
4
{
public static int removeodd (int[] values, int size)
6
/* Your code here */
8
public static void main(String[] args)
10
EarthquakeStrength
11
int(] a = { 22, 98, 95, 46, 31, 53, 82, 24, 11, 19 };
int sizeBefore = 8;
int sizeAfter = removeodd(a, sizeBefore);
System.out.print ("a: [ ");
for (int i = 0; i< sizeAfter; i++)
ElevatorSimulation2
12
Error1
13
C Error2
C Error3
© FindSpaces
FirstVowel.java
e Geometry
C Grades
HelloPrinter
eIntegerName
InvestmentTable
ljoh661.zip
© Numbers
e PasswordGenerator
PowerTable
14
15
16
17
System.out.print(a[i] +" ");
18
I }
19
System.out.println("]");
20
System.out.println("Expected: [ 22 98 46 82 24 ]");
21
22
int[] b = { 23, 97, 95, 45, 31, 53, 81, 24, 11, 19 };
23
sizeBefore = 7;
24
sizeAfter = removeodd(b, sizeBefore);
25
System.out.print("b: [ ");
for (int i = 0; i< sizeAfter; i++)
PrintDemo
e PrintTableDemo
C Prog06_PartyPooper
e Pyramids
G RandomDemo
C ReadTime
e ReciprocalSum
26
27
28
System.out.print(b[i] + " ");
29
}
30
System.out.println("]");
31
System.out.println("Expected: [ ]");
RemoveDuplicateWords
G RemoveTester
C Reverse
e SentinelDemo
e Shipping
G TaxCalculator
e test
e UniqueChars
32
33
e Volume1
csC 1350.im!
> l External Libraries
o Scratches and Consoles
E TODO
O Problems
A Build
|Terminal
MacBook Pro
esc
O Reverse
@
#3
$
&
1
4
Transcribed Image Text:0 src e RemoveTester m main roject C PrintDemo.java X e PasswordGenerator.java x G IntegerName.java x C Grades.java test.java x C ArrayDemo,java x x © Num cSC 1350 -/ldeaProjects/CSC 1350 import java.util.Arrays; 1 .idea 2 out 3 > public class RemoveTester src C ArrayDemo C Boxes e Compare2 e Cubes e DoLoop © Doublelnvestment2 C DuplicatedCharacters 4 { public static int removeodd (int[] values, int size) 6 /* Your code here */ 8 public static void main(String[] args) 10 EarthquakeStrength 11 int(] a = { 22, 98, 95, 46, 31, 53, 82, 24, 11, 19 }; int sizeBefore = 8; int sizeAfter = removeodd(a, sizeBefore); System.out.print ("a: [ "); for (int i = 0; i< sizeAfter; i++) ElevatorSimulation2 12 Error1 13 C Error2 C Error3 © FindSpaces FirstVowel.java e Geometry C Grades HelloPrinter eIntegerName InvestmentTable ljoh661.zip © Numbers e PasswordGenerator PowerTable 14 15 16 17 System.out.print(a[i] +" "); 18 I } 19 System.out.println("]"); 20 System.out.println("Expected: [ 22 98 46 82 24 ]"); 21 22 int[] b = { 23, 97, 95, 45, 31, 53, 81, 24, 11, 19 }; 23 sizeBefore = 7; 24 sizeAfter = removeodd(b, sizeBefore); 25 System.out.print("b: [ "); for (int i = 0; i< sizeAfter; i++) PrintDemo e PrintTableDemo C Prog06_PartyPooper e Pyramids G RandomDemo C ReadTime e ReciprocalSum 26 27 28 System.out.print(b[i] + " "); 29 } 30 System.out.println("]"); 31 System.out.println("Expected: [ ]"); RemoveDuplicateWords G RemoveTester C Reverse e SentinelDemo e Shipping G TaxCalculator e test e UniqueChars 32 33 e Volume1 csC 1350.im! > l External Libraries o Scratches and Consoles E TODO O Problems A Build |Terminal MacBook Pro esc O Reverse @ #3 $ & 1 4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT