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

 

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

For this problem you may NOT use arrays, ArrayList, Strings, or any other advanced data types. You may ONLY use basic data types! In fact, you COULD do this whole thing JUST using int. (You are allowed to also use boolean if you want to). Write a method that accepts an input parameter which is a two or more digit positive integer. Return an integer value that represents the input parameter but with the digits in the 10's place and 1's place swapped. For example, if the input parameter is 542 you would return 524. Remember you may ONLY use basic data types and no arrays!


test2020_12_10_HL_swapDigits(542) → 524
test2020_12_10_HL_swapDigits(1245) → 1254
test2020_12_10_HL_swapDigits(92418) → 92481

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

public int test2020_12_10_HL_swapDigits(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