beyondgrader.com Logo
DemoBrowseAboutTeamLogin

Array Sum Even (One Dimensional)

Geoffrey Challen // 2021.2.0

Declare and implement a function called arrayEvenSum that receives a one-dimensional array of Int values (IntArray) as its only parameter and returns the sum of the even values in the array as an Int. As a reminder, you can test whether an Int is even using the remainder operator (%). If the array is null you should return 0.