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

 

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

Write a method that accepts an array of integers and a number to be skipped. Return the sum of all the integers in the array, but do not include any occurrences of the number to be skipped in the sum.


chronicSum([5, 5, 5], 5) → 0
chronicSum([], 3) → 0
chronicSum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 16) → 120

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

public int chronicSum(int[] nums, int skipNum) { }

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

Copyright Nick Parlante 2017 - privacy