Final answer:
The function to return the sum of all even numbers in a matrix with m rows and n columns is sumEven(matrix). The function should iterate through each element in the matrix and use the rem(n,2) function to determine if the number is even or odd. If the number is even, it should be added to a running total.
Step-by-step explanation:
The correct function to return the sum of all even numbers in a matrix with m rows and n columns is a) sumEven(matrix). The function should iterate through each element in the matrix and use the rem(n,2) function to determine if the number is even or odd. If the number is even, it should be added to a running total. Once all elements have been checked, the function should return the final sum. Here is an example implementation in Python:
def sumEven(matrix):
total = 0
for row in matrix:
for num in row:
if rem(num, 2) == 0:
total += num
return total