Question: C# Write and test a recursive function named countCaps that counts and returns the number of uppercase letters in a string. The function will take

C# Write and test a recursive function named countCaps that counts and returns the number of uppercase letters in a string. The function will take an array containing a null-terminated string as its first argument and an integer representing the starting subscript of the array (portion of the array) to be processed as its second argument.

We will test your function in our framework so it must have the following prototype:

int countCaps(char array[], int firstElem);

Your function must work for any character array containing a null-terminated string. On the initial call your function will be passed the array and the subscript 0.

Sample Outputs:

There are 26 uppercase letters in the string: aAbBcCdDeEfF0123gGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ @]

There are 0 uppercase letters in the string: 0123456789@]

There are 6 uppercase letters in the string: We the People of the United States, in Order to form a more perfect Union,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!