Sum of Even Numbers in a List
Not Started

Implement the method, sumOfEvenNumbers, that takes a list of integers as input and returns the sum of all even numbers in the list. If there are no even numbers, the method should return 0.

Example 1

Input: [1, 2, 3, 4, 5, 6]
Output: 12
Explanation: The even numbers in the list are 2, 4, and 6. Their sum is 2 + 4 + 6 = 12


Example 2

Input: [7, 9, 13, 15]
Output: 0
Explanation: There are no even numbers in the list, so the result is 0


Example 3

Input: [2, 4, 6, 8, 10]
Output: 30
Explanation: The even numbers in the list are 2, 4, 6, 8, and 10. Their sum is 2 + 4 + 6 + 8 + 10 = 30.