id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > practice2023_10_20_sumEvens
prev  |  next  |  chance

Write a method that returns the sum of all the POSITIVE EVEN integers in 'nums'. Do not count odd integers or negative integers in the sum.


practice2023_10_20_sumEvens([-8, -200, -40, -6]) → 0
practice2023_10_20_sumEvens([7, 12, 17, 800, 80, 12]) → 904
practice2023_10_20_sumEvens([5, 2, 70, 24, 43, 856, 24, 239, 3]) → 976

...Save, Compile, Run (ctrl-enter)

public int practice2023_10_20_sumEvens(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 220

Copyright Nick Parlante 2017 - privacy