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

 

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

Write a method that accepts an array of any length. Each element in the array will be a positive number. Your goal is to find the sum of all the digits in all the ones places of all the numbers in array 'nums'. Return the sum of all the digits in the ones places. Look at the test data for examples. As a precondition you may assume that the array meets all the conditions explained above.


test2023_11_02_APP1SLHL_sumOnesPlace([325, 912, 1240]) → 7
test2023_11_02_APP1SLHL_sumOnesPlace([42694]) → 4
test2023_11_02_APP1SLHL_sumOnesPlace([]) → 0

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

public int test2023_11_02_APP1SLHL_sumOnesPlace(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