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 addOdds(int 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 main(String[] args){
Scanner in = new Scanner(System.in);
int num1, num2, num3, num4, num5;
num1= in.nextInt();
num2= in.nextInt();
num3= in.nextInt();
num4= in.nextInt();
num5= in.nextInt();
System.out.printIn(addOdds(num1,num2,num3,num4,num5));
}
}
```
STDOUT
Expected STDOUT
8
Add Odds Only Given parameters \ ( a , b , c , d

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!