Question: b. Given the String class and the Character class as shown in the following UML, write a program to perform the following tasks. (15pts) (1).

b. Given the String class and the Character class as shown in the following UML, write a program to perform the following tasks. (15pts) (1). Read a string from the console. (2). Count the number of each letter ('a' ~z) in the string, ignoring the cases. (3). Display the results to the console. java.lang.String Retums the number of characters in this string. -lengthO: int charAt(index: int): char Retuns the character at the specified index from this string. concat(sl: String): String Retums a new string that concatenate this string with string s1. java.lang.Character Constructs a character object with char value Returns the char value from this object +Character(value: char) +char Value0: char +compare To(anotherCharacter: Character): int Compares this character with another equals(anotherCharacter: Character): boolean Returns true if this character equals to another Returns true if the specified character is a digit Returns true if the specified character is a letter Returns true if the character is a letter or a digit Returns true if the character is a lowercase letter Returns true if the character is an uppercase letter Returns the lowercase of the specified character Returns the uppercase of the specified character isLetterf(ch: char): boolean tisLetterOrDigit(ch: char): boolean isUpperCaserch: char): boolean
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
