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