Question: In the following program, the code for function OddEvenDiet is missing. This function should return the absolute difference of the sums of odd numbers and

 In the following program, the code for function OddEvenDiet is missing.

In the following program, the code for function OddEvenDiet is missing. This function should return the absolute difference of the sums of odd numbers and even numbers in the vector passed as the parameter. Examples: Input -[1.2.3,4,5 Output: 6 Explanation: the sum of odd numbers is 1+3+5-9. the sum of even numbers is 244, the difference is 9-4.5. Input: 121 Output: 2 Explanation the sum of even numbers is 262. there is no odd number, so the sum of odd numbers is 0. the difference is 2-0-2 Implement the function on your computer and put your solution inside the function. Please note that you are allowed to use the sorting function to solve this problem you will get Opoinn Also, you are not alowed to modify any other parts of the program Submit the following 1. The code insidde Oddtvenbart function. (60%) 2. The absolute difference of the sum of odd numbers and event numbers the list passed by the main. This is the output of your program. (09) #include #include cvector using namespace std; the OddEvenbifr (const vector in v) Put your code here

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 Databases Questions!