Question: Problem 1 In example program Example 1 1 Recursion, write a recursive function sumDigits ( int n ) that computes the sum of the digits

Problem 1
In example program Example11Recursion, write a recursive function sumDigits(int n)
that computes the sum of the digits in the given integer n.
For example, a function call sumDigits(429875) should return 35.
Problem 2
In example program Example11Recursion, implement a recursive approach to counting the
occurrences of uppercase letters in a given string s. You should define the following two
functions, the second of which is a recursive helper function that uses parameter high to
indicate the right boundary of the substring for the function to check on.
int countUppercase(String s)
int countUppercase(String s, int high)
For example, a function call countUppercase(Computer Networking:
Protocols&Applications) should return 4.

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 Programming Questions!