What IDE are you using?
It seems like you need to organize your brackets. Pretty much error is saying your while ( expression ) is after the wrong bracket (not at the end of the do statement.).
Type: Posts; User: Rend
What IDE are you using?
It seems like you need to organize your brackets. Pretty much error is saying your while ( expression ) is after the wrong bracket (not at the end of the do statement.).
Scanner scan = new Scanner(System.in);
System.out.println("Enter letter: ");
a = scan.next();
int count = 0;
for (int i = 0; i < a.length(); i++) { ...
if ((word.indexOf(a)!=-1))
This is not the right way to check through the string for a letter. What you're actually doing is checking the index of the letter you are looking for (in this case "a")...
Use .next() instead of .nextLine();
I forgot specifically why, but .nextLine(); is a little flawed in a way that it sometimes forgets the input or overwrites it.