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

 

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

Write a method that returns the sum of the POSITIVE integers in an array of any kind of integer. Look at the test data.


smaugCountsPositives([40, -20, 10, -5, -2, 0, 12]) → 62
smaugCountsPositives([-42, -4, -2, -182, -45]) → 0
smaugCountsPositives([]) → 0

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

public int smaugCountsPositives(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