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

 

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

Write a method that returns the number of EVEN numbers contained in the 'nums' array. For example, if 'nums' contains {71,53,58,-32,0,72,60} you would return 5 since 58, -32, 0, 72, and 60 are all even numbers, but the other elements of the array are NOT even. Look at the test data for additional examples.


quiz2023_12_13_APP1SLHL_countEvens([]) → 0
quiz2023_12_13_APP1SLHL_countEvens([7]) → 0
quiz2023_12_13_APP1SLHL_countEvens([5, 20, 53, 236, 57, 3, -77, 568, -80, 4, -4, 1, -1, 3425, 45, 768, 214, 79, -455, 62346]) → 9

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

public int quiz2023_12_13_APP1SLHL_countEvens(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: 230

Copyright Nick Parlante 2017 - privacy