Anybase to Anybase

Hi , I am at Section 3: Function & 1D Array. Teacher briefly mentioned the method to convert from any base to any base, but no detailed working was shown. So I have attempted this coding problem, but am a little lost. I have attached my work below. package Section3_Functions;

import java.util.Scanner;

public class S3_5_Anybase_To_Anybase {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int originalNum = s.nextInt();
int originalBase = s.nextInt();
int destinationBase = s.nextInt();

    int answer = anyBaseToAnybase(originalNum, originalBase, destinationBase);
    System.out.println(answer);

}

public static int anyBaseToDecimal(int originalNum, int originalBase) {
    int answer = 0;
    int multipler = 10;
    while(originalNum != 0){
        int remainder = originalNum % 10;
        answer = answer + (remainder * multipler);
        multipler = multipler * originalBase;
        originalNum = originalNum / 10;
    }
    return answer;


}

public static int decimalToAnybase( int answerFromFirstMethod, int destinationBase) {
    int finalAnswer = 0;
    int multiplier = 1;
    while(anyBaseToDecimal() != 0){
        int remainder = anyBaseToDecimal.answer % destinationBase;
        finalAnswer = finalAnswer + (remainder * multiplier);
        multiplier = multiplier * 10;
        originalNum = originalNum / destinationBaseNum;

    }
    return finalAnswer;
}

}

@sumyatkw,
Your code is correct. Just a few errors.

In anyBaseToDecimal, the multiplier should be 1 instead of 10. Because we start from 0 not 1.

And then in the decimalToAnybase method:
you need to do calculations using the answerFromFirstMethod value. So just replace originalNum with answerFromFirstMethod and anyBaseToDecimal.answer to answerFromFirstMethod.

Also in the main method you need to do:

		int answer = anyBaseToDecimal(originalNum, originalBase);
		answer = decimalToAnybase(answer, destinationBase);
		System.out.println(answer);

Because anyBaseToDecimal accepts only 2 arguments.

https://ide.codingblocks.com/s/257863 This is the code that I corrected. But first try to iron out the errors yourself and look at it only if you really need to.