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

 

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

Write a method with two integer parameters. The first parameter is a positive decimal integer. The second parameter is an integer from 2 to 10 inclusive. This second parameter indicates which base to convert the first parameter to. Return a string representing the number in the indicated base. For example, toBase(34,2) returns "100010 base 2". toBase(173,10) returns "173 base 10".


toBase(9, 2) → "1001 base 2"
toBase(64, 2) → "1000000 base 2"
toBase(456780, 2) → "1101111100001001100 base 2"

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

public String toBase(int startNum, int base) { }

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