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

Write a method that has a single input parameter 'num'. As a precondition you may assume that 'num' will be a two-digit positive integer. Return the sum of the digits in 'num'. For example, if 'num' is 27 you will return 9 since 2+7=9. Look at the test data for more examples.


test2020_11_12_APP1SLHL_addDigits(84) → 12
test2020_11_12_APP1SLHL_addDigits(85) → 13
test2020_11_12_APP1SLHL_addDigits(86) → 14

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

public int test2020_11_12_APP1SLHL_addDigits(int num) { }

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

Copyright Nick Parlante 2017 - privacy