You intend to use recursion, so there should not be a while loop.

One problem I see is that your requirements are weird: the number to convert is given as an int. Therefore, the initial base does not make sense. For example, what should the result of baseConversion(10, 8, 10) be? According to your requirements, it means that 10 should be interpreted as being the representation of a number in base 8, then you convert the representation to base 10. Problem is, the value of the first argument is 10_10 (i.e., 10 in base 10), not 8_10 (which is what it would be if we are talking about 10_8). I suggest that you clarify this with your instructor.