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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started