How to convert numbers to binary and hex (without built-in functions)?
<p>Since this is homework, I can't use built-in functions. I have to use algorithms in Java.</p>

<p>This is what I have so far but it is wrong. </p>

<pre><code>import java.util.Scanner;

public class ChangingFigures {
    public static void main (String[] args){
        Scanner scanner = new Scanner (System.in);
        System.out.print("Enter an integer between 0 and 127:");

        int num = scanner.nextInt ();

        String hex = Integer.toHexString(num);
        String bin = Integer.toBinaryString(num); 
        // ...
    }
}
</code></pre>
