Write a recursive method called doubleDigits that accepts an integer n as a parameter and returns the

Question:

Write a recursive method called doubleDigits that accepts an integer n as a parameter and returns the integer obtained by replacing every digit of with two of that digit. For example, doubleDigits(348) should return 334488. The call doubleDigits(0) should return 0. Calling doubleDigits on a negative number should return the negation of calling doubleDigits on the corresponding positive number; for example, doubleDigits(–789) should return –778899.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: