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

 

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

Write a method that accepts an array of integers and returns the sum of all the POSITIVE integers from the array.


arrayPosSum([5, 4, -2, 6]) → 15
arrayPosSum([-24, -42, -122, -4, -9]) → 0
arrayPosSum([4, 10, 200, -6, 30, -7, -21]) → 244

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

public int arrayPosSum(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: 250

Copyright Nick Parlante 2017 - privacy