Log in

View Full Version : Java program compute number of times a character appears HELP


h007
May 9, 2016, 04:37 AM
Design a program to compute the number of times the character e occurs in a string s. The program should not distinguish between lower and upper case characters.
For example if the user entered the following input:

char e = ‘t’
String s = “aCT5De HTEetbN1”

Then the output would be 3.
In your answer clearly detail the design of the program as well as creating the code for the solution.

CravenMorhead
May 9, 2016, 06:41 AM
While I could bang this out in about 5 minutes and probably 20 lines of documented code, I am not going to do your homework for you. You need to learn how to do simple loops.

What do you have already? I can help you with road blocks from there on in.