Question: Part e Write a program that prompts the user to enter a string and displays the number of the uppercase letters in the string. For

Part e

Write a program that prompts the user to enter a string and displays the number of the uppercase letters in

the string.

For exampl

e:

Enter a string:

Wentworth Is Terrific

There are 3 uppercase characters in the string.

Enter a string:

break was short :(

There are no uppercase characters.

Enter a string:

Glad to be back coding!

There is 1 uppercase character in the string.

Starter code:

public class LA1e { /** * Counts the number of upper case characters * within the supplied string * * @param s input string * @return number of upper case characters */ public static int numUpperCase(String s) { return 0; // TODO: replace with your method implementation }

// TODO: document this method public static void main(String[] args) { // TODO: write your code here }

}

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!