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

 

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

Write a method that finds the sum of all the integers in an array called 'nums', up to, but not including the first occurrence of 'stopVal'. For example, if 'nums' is {5,7,13,8,2,15,11} and 'stopVal' is 8, you would return 25 since 5+7+13=25.


nov21_2019_APP1SLHL_addUntil([], 52) → 0
nov21_2019_APP1SLHL_addUntil([12], 12) → 0
nov21_2019_APP1SLHL_addUntil([5, 2, 3, 7, 8, 2, 4, 9, 6, 1], 9) → 31

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

public int nov21_2019_APP1SLHL_addUntil(int[] nums, int stopVal) { }

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