I'm not registered for this course but if the question says you should have a parameter, then you should only have one. I don't understand why you want two though, there seems no reason for it. What do you need rev for?
If you use it to get the result of the calculation, it's redundant, you can simply return the result.
Also, as long as it comes back as an integer, I very much doubt it matters that much what you do with it inside the function.
And if you handle it as a string you need not concern yourself with any of the peculiarities of computer arithmetic (even though they're unlikely to be troublesome in this particular case). I think I'll go for the string route when I get here.
After getting some advice, I tried to fix the function to take only one parameter. I got the function to work, but I am still unsure about my base case.
robanaurochs kindly pointed out my previous base case
if(num != 0)
was not quite testing the base case that the number only has one digit, which means numbers with one digit actually ran through twice.
I am unfortunately stuck. As it stands now, with only one parameter I have changed my base case to
if(num > 0)
but I am still not convinced that it is a good base case. it seems to be the same as the previous one.
If I use
if(num/10 > 0)
the program seems to work and it seems to test correctly. I just need some confirmation that this is in fact correct.
Far and away the best prize that life has to offer is the chance to work hard at work worth doing.