amyre
amyre
15.02.2021 • 
Engineering

Recursion Intro Assignment. You may not use for or while. Any looping must be accomplished using recursion. You may not declare static or non-static member fields – only local or parameter variables allowed.Implement the method public static long eduodd (long n). eduodd(n) returns a value which increases each of the even decimal digits of n by one and decreases each of the odd digits of n by one. Leading one digits will disappear. The sign of eduodd(n) should be the same as n, unless n is negative and eduodd(n) is zero as seen in the last example below. Please review the written practice recursion problems as seen in class. Table of examples: n 0 27 11121113 -11 987654321 -8443 eduodd(n) 1 36 30002 0 896745230 -9552

Solved
Show answers

Ask an AI advisor a question