Sentences are normally terminated by a full stop (.), an exclamation point (!), or a question mark (?), and they may or may not be bracketed with parentheses () or square-brackets [].
Why not just check to see if the last, non-bracket character is one of the sentence terminators? If it is, then you know to stop reading.
A couple of other comments. I don't know if your professor has asked you to do this or not, but things like
1 2
|
#define one 1
const string rooster = "rooster";
|
etc. are quantifiably, er, stupid --though you will find such spread around a lot of code. If you are checking for a rooster, check for the rooster directly, instead of using some "constant" that someone may have changed on recompilation.
else if (inputWord == "rooster")
The other comment is about how you check the input word. What if the user inputs:
I wish I were a rooster, but I am not. |
or
Roosters make for happy hens. |
(sorry :-P)
In both cases, the simple == operator will fail to identify them. You need to
1 Normalize them (convert the input to upper- or lower-case), and
2 Search for them using one of the
string::find() functions.
Hope this helps.