Question: Write a recursive method to return the number of uppercase letters in a string. Write a test program that prompts the user to enter a
Write a recursive method to return the number of uppercase letters in a string.
Write a test program that prompts the user to enter a string and displays the number of uppercase letters in the string.
Note that writing a non-recursive method will lead to a zero mark.
Hint: you can use Character.isUpperCase() method to check whether a character is uppercase or not.
The following example shows what the user will see on the screen:
This program calculates the number of lowercase letters in a string. Enter a string: HelloWorld! The number of lowercase letters:2
In the above examples, user should provide the information shown in italic. Your program should calculate and display the rest. Test your program with different inputs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
