This is what I have so far and I don't know where to go from here. (I am a beginner so please try to use simple logic for me to understand)
public static void countSentences(String text) {
String comma = ",";
String period = ".";
String Question = "?";
String ex = "!";
text = "..,,??!!";
int c = 0;
for (int i = 0; i < text.length(); i++) {
if (comma.equals(text.charAt(i)) || period.equals(text.charAt(i)) ||
Question.equals(text.charAt(i)) || ex.equals(text.charAt(i))) {
c += 1;
}else {
c += 0;
i++;
}
}
}