TopcoderArchiveVisit Topcoder
Archive
Algorithm problem

Converter

Problem statement, definition, constraints, and public examples.

Problem Statement

Base-8 (octal) numbers consist of digits from 0 to 7. They work as follows: the
right-most value gets multiplied by 8^0 (eight to the 0 power), and each column
to the left increases the power by 1. The decimal value of a octal number is
the sum of all these partial sums.
For example, the octal number '317' is equal to 7*8^0 + 1*8^1 + 3*8^2  = 7 + 8
+ 192 = 207.

Help him out by creating a class Converter containing the method getOctal(int).
This takes a decimal argument and converts it to the Base-8 equivalent returned
as a String. Here is the method signature:

public String getOctal(int input);

Definition

Class:
Converter
Method:
getOctal
Parameters:
int
Returns:
String
Method signature:
String getOctal(int param0)
(be sure your method is public)

Constraints

    Examples

      No public sample cases were explicitly marked for this problem in the original data.

      Back to all problems