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

 

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

Write a method that finds the sum of all the integers in array 'nums' except any occurrence of 'exclude' is not counted in the sum. Look at the test data for examples. Remember, you may only have ONE return statement in each method.


test2021_09_02_SLHL_sumExcluding([18, 12, 11, -5, 18, 42, 25, 100], 7) → 221
test2021_09_02_SLHL_sumExcluding([18, 12, 11, -5, 18, 42, 25, 100], 18) → 185
test2021_09_02_SLHL_sumExcluding([3, 7, 13, 17, 23, 27, 50000], 50000) → 90

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

public int test2021_09_02_SLHL_sumExcluding(int[] nums, int exclude) { }

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

Copyright Nick Parlante 2017 - privacy