Honor Code Acknowledgment: _____________________________
Due: Friday, June 25, 1999 8 points
Write a function named MaxNumWordsPerLine that reads input and returns the maximum number of words on a line. You must use getline to read in a line and a string stream to count the number of words per line.
For example, if the input is the following:
The thousand injuries of Fortunato I had borne as I best could, but when he ventured upon insult I vowed revenge. You, who so well know the nature of my soul, will not suppose, however, that I gave utterance to a threat.Then MaxNumberWordsPerLine() returns 9.
int MaxNumberWordsPerLine()
// postcondition: returns the maximum number of words per line.
{
Write a recursive function named EveryOtherReverse that prints every other word (starting with the first word) in reverse order. The word "stop" indicates the end of the input and should not be printed.
For example, if the input is the following:
a b c d e f g h i j k l m n that is all folks stop
Then EveryOtherReverse(0) prints the line shown below. (starting with a, every other word, in reverse order)
all that m k i g e c a
Your function must be recursive to receive credit. The parameter num can be used to keep track of the number of words processed.
void EveryOtherReverse(int num)
// postcondition: prints every other word in reverse order
{