[Solved] JAVA: I have to write a program to read “sentences” from a file and and then count the number of words and vowels per sentence [closed]
Couple of issues: You are using last user entered sentence while you should use text that you read from file like below: StringTokenizer words = new StringTokenizer(text); numberofwords=numberofwords+words.countTokens(); for (i=0;i<text.length();i++) { ch=text.charAt(i); if (ch==’a’||ch == ‘A’ || ch == ‘e’ || ch == ‘E’ || ch == ‘i’ || ch == ‘I’ || ch == … Read more