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

 

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

Write a method that returns the sum of the numbers in array 'nums', except do not include the number 7 in the sum. For example, if 'nums' is [7,27,71,7,7] you would return 98 since 27+71=98. Remember that the number 7 is not supposed to be included in the sum (the NUMBER 7, not the DIGIT 7). Look at the test data for further examples.


test2020_11_12_APP1SLHL_sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) → 59
test2020_11_12_APP1SLHL_sum([42817, 325, 124, 364, 523]) → 44153
test2020_11_12_APP1SLHL_sum([75]) → 75

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

public int test2020_11_12_APP1SLHL_sum(int[] nums) { }

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

Copyright Nick Parlante 2017 - privacy