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

 

amjadm@miamioh.edu > countPositive
prev  |  next  |  chance

Given an array of ints, return the number of positive values in the given array array. Use enhanced/foreach loop for getting the elements of the array.


countPositive([]) → 0
countPositive([1, -2, 3]) → 2
countPositive([1, -1, -1, -2, 0]) → 2

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

public int countPositive(int[] arr) { }

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: 170

Copyright Nick Parlante 2017 - privacy