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

 

mar7_2017_APSLHL_sumGreater


Write a method that returns the sum of all the elements in 'nums' that are greater than 'boundary'. For example, if nums={3,6,2,5} and boundary=3 the method would return a value of 11 since 5+6=11. Only 5 and 6 are greater than 3, so those would be the only numbers from the array used in the sum.


mar7_2017_APSLHL_sumGreater([253, 214, 24], 50) → 467
mar7_2017_APSLHL_sumGreater([241], 1) → 241
mar7_2017_APSLHL_sumGreater([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], -42) → 144

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

public int mar7_2017_APSLHL_sumGreater(int[] nums, int boundary) { }

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

Copyright Nick Parlante 2017 - privacy