Consider the following recursive function: (2, 3, 4, 6) void funcEx8(int u, char v) //Line 1 { //Line 2     if (u == 0) //Line 3         cout     else //Line 5     { //Line 6         int x =...


Consider the following recursive function: (2, 3, 4, 6)


void funcEx8(int u, char v) //Line 1


{ //Line 2


    if (u == 0) //Line 3


        cout <><>


    else //Line 5


    { //Line 6


int x = static_cast(v); //Line 7

        if (v <>


v = static_cast(x + 1); //Line 9

         else if (v > 'Z') //Line 10


v = static_cast(x - 1); //Line 11

        cout <><>


        funcEx8(u - 2, v); //Line 13


} //Line 14


} //Line 15


Answer the following questions:


a. Identify the base case.


b. Identify the general case.


c. If funcEx8(26, '$'); is a valid call, what is the output? If not, explain why.


d. If funcEx8(11, 'B'); is a valid call, what is the output? If not, explain why.


e. If funcEx8(18, '^'); is a valid call, what is the output? If not, explain why.




May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here