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

 

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

Hobbits have a very peculiar way of writing their numbers. They count in base 8, but they write their base 8 numbers in the reverse order compared to us. For example, the number 42 converts to base 8 as 52(base 8), but of course, the hobbits write this as 25. This also means that numbers like 80 which convert to 120(base 8) will be written by the hobbits as 021. Write a method that accepts a positive integer in base 10 and returns a string representing how the hobbits would write that number. Look at the test data for further examples.


hobbitCount(10) → "21"
hobbitCount(32) → "04"
hobbitCount(6) → "6"

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

public String hobbitCount(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: 290

Copyright Nick Parlante 2017 - privacy