counting letters in a string
im working on something that requires me to have a user input a string like:
wEWEWwewewetrtrtrTRTRTRTREEEEEeee
i need to return a statement stating how many w's, e's, t's, and r's and a percentage of how many times each letter is inputted.
i already have my method that scans in the information and i think i understand how to do the necessary loops, but the return is what i am stuck on.
and as far as the upper and lower case i think this works right?
public static boolean isLetter(char c) {
if (c == 'w' || c == 'W') {
return (true);
} else if (c == 'e' || c == 'E') {
return (true);
} else if (c == 't' || c == 'T') {
return (true);
} else if (c == 'r' || c == 'R') {
return (true);
}
return false;
}