Question: Add Odds Only Given parameters ( a , b , c , d ) , and ( e ) , passed
Add Odds Only
Given parameters a b c d and e passed into the addOdds method, do the following:
Declare a List of Integer, you can name the List whatever you want.
quad Put each parameter into the List as an element, in order from a to e
Write code that can find the sum of all the odd integers in the List
return the sum of the odd integers
import java.io;
import java.util.;
public class CodingQuestion
static int addOddsint a int b int c int d int e
DO NOT CHANGE THE CODE BELOW THIS LINE
WRITE YOUR CODE HERE
end of addOdds
DO NOT CHANGE THE CODE BELOW THIS LINE
public static void mainString args
Scanner in new ScannerSystemin;
int num num num num num;
num innextInt;
num innextInt;
num innextInt;
num innextInt;
num innextInt;
System.out.printInaddOddsnumnumnumnumnum;
STDOUT
Expected STDOUT
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
