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

 

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

Write a method that returns the sum of the digit in the one's place and the digit in the ten's place of 'num'. For example, if 'num' is 4738 you would return 11 since 8+3=11. The 8 came from the one's place and the 3 came from the ten's place. As a pre-condition, you may assume that 'num' is positive and has at least two digits. You may NOT use any strings or string methods for this problem.


test2021_10_07_APSLHL_addFirstTwoDigits(123456) → 11
test2021_10_07_APSLHL_addFirstTwoDigits(924834) → 7
test2021_10_07_APSLHL_addFirstTwoDigits(48127) → 9

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

public int test2021_10_07_APSLHL_addFirstTwoDigits(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: 250

Copyright Nick Parlante 2017 - privacy