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_SLHL_sum2
prev  |  next  |  chance

Write a method that returns the sum of the numbers in array 'nums', except do not include the digit 7 in the sum. Remove the digit 7 from all the elements of the arry. For example, if 'nums' is [475,7,27,71,7,7] you would return 426 since 405+20+1=426. Remember that the DIGIT 7 is not supposed to be included in the sum (the DIGIT 7, not just the number 7). Look at the test data for further examples. Keep in mind that when the digit 7 is omitted, it does not change the place value of all the other digits in the number.


test2020_11_12_SLHL_sum2([32]) → 32
test2020_11_12_SLHL_sum2([7]) → 0
test2020_11_12_SLHL_sum2([7877, 507, 723, 771]) → 1324

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

public int test2020_11_12_SLHL_sum2(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: 290

Copyright Nick Parlante 2017 - privacy