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

 

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

Write a method with two integer input parameters. As preconditions, you can assume that both integers are non-negative. Return the sum of the digits in the ones place in these numbers. For example, if the two integers are 562 and 11128, you would return 10 since the one's places are 2 and 8 and the sum of those is 2+8=10. However, if the sum of the digits in the one's place is 13, return -99 instead.


test2024_10_08_APP1SLHL_onesSum(1276, 43987) → -99
test2024_10_08_APP1SLHL_onesSum(18, 42) → 10
test2024_10_08_APP1SLHL_onesSum(7382, 9124) → 6

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

public int test2024_10_08_APP1SLHL_onesSum(int a, int b) { }

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

Copyright Nick Parlante 2017 - privacy