Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gitaficionado/65deace78c9ffc94e0b9df20a691864f to your computer and use it in GitHub Desktop.
Save gitaficionado/65deace78c9ffc94e0b9df20a691864f to your computer and use it in GitHub Desktop.
(Count uppercase letters) Write a program that prompts the user to enter a string and displays the number of the uppercase letters in the string.
public class CountUppercaseLetter_Exercise05_50 {
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Enter a string: ");
// Create a string with user input
_______________________________________
//Create a variable of int type called total
____________________
// create a for statement that recognizes whether a string contains capital letters.
System.out.println("The number of uppercase letters is " +
total);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment