This question comes up remarkably often, and you should look through the posts before submitting. You should also (in any forum) post any code that can show your progress (you will find people reluctant to do your entire assignment for you).
Basically what I would do is:
1)get a String (and array/stream of character) from the input.
2)sort the string into alphabetical (or any order so long as like characters appear together) order.
3) when the search character is entered, look for it (by iterating the entire length or by other means) in the string and count for how long it occurs .
eg if
Input = "The rain in spain falls mainly in the plain"
sortedString = "aaaaaefhiiiiiillllmnnnnnnpprst"
char=i;
loop characters to find i then count
-
while(currentChar==i)
-
{
-
counter++;
-
*currentChar++
-
}
-
This is not necessarily the best (or even easiest answer) but I leave it tou you to either implement, improve on or find something else....