First Program:

Your program is returning an incorrect number of words, so there is something wrong with your logic. This program can be accomplished much more easily with a variable that is used...