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

 

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

Write a method that returns the numeric value of the last two digits of input parameter 'num'. The 'last two' digits means the digits in the ten's place and the one's place. As a precondition you may assume that 'num' is positive. Note that 'num' could contain only a single digit, in which case you return that single digit. Also note that the last two digits could both be zeros, in which case you return the value of zero because '00' has a value of zero. Look at the test data for examples.


test2022_10_13_APP1SLHL_lastTwoDigits(352000) → 0
test2022_10_13_APP1SLHL_lastTwoDigits(21896) → 96
test2022_10_13_APP1SLHL_lastTwoDigits(412) → 12

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

public int test2022_10_13_APP1SLHL_lastTwoDigits(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: 220

Copyright Nick Parlante 2017 - privacy