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

 

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

Write a method that returns the sum of an array of integers 'nums', except do not include any occurrence of the number 'omit' in the array. If all of the values in the array equal 'omit', then return the sum as zero. Look at the test data for examples. The array can be of any length, including a length of zero, in which case you should return zero.


Sept13_2019_SLHL_sumOmit([5, 4, 3, 7, 6, 5, 8, 7, 6, 5, 4, 1], 5) → 46
Sept13_2019_SLHL_sumOmit([7], 2) → 7
Sept13_2019_SLHL_sumOmit([], 5) → 0

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

public int Sept13_2019_SLHL_sumOmit(int[] nums, int omit) { }

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