about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy