All pastes #443503 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-16 20:55 UTC
rendered paste body
Write a C program that will process a series of "words" entered by the user. A word (for the purpose of this assignment) is defined as a sequence of non-white-space characters (anything other than a space, a tab, or a newline). The following activities should be performed in the program, and on the data entered by the user:

The program's output should begin (as always) with the course number, problem number, your name, and your email address.

The program should then prompt the user to enter a series of lines of text. The program should handle any number of lines.

After the last word has been entered by the user, the program should display the following information about the lines of words entered by the user:

The total number of words entered.

The number of capitalized words entered.

The longest word entered (the word with the greatest number of characters).

The shortest word entered (the word with the fewest number of characters).

The number of sentences in the text entered (remember that a sentence is considered to be a series of words followed immediately by a sentence-ending punctuation character (period, exclamation point, or a question mark)).

The number of words in the longest sentence. (Note that if the last sequence of words in the input stream does not have a sentence-ending punctuation character at the end of it, you should still count that sequence as a sentence.)

The number of words in the shortest sentence.

The average word length.