Submit your work through the Canvas link.
Educational goals of this lab - verify that every student can
Enter a line of words, press Enter to stop: the cat in the hat Enter a line of words, press Enter to stop: Hi there 12345 9 Enter a line of words, press Enter to stop: &&& Enter a line of words, press Enter to stop: There were 10 words Average word length 3.00
Enter a line of words, press Enter to stop: There were 0 words Average word length 0.00
Enter a line of words, press Enter to stop: 13 15 17 19 Enter a line of words, press Enter to stop: the end of the execution Enter a line of words, press Enter to stop: There were 9 words Average word length 3.11
Enter a line of words, press Enter to stop: apple Enter a line of words, press Enter to stop: ball Enter a line of words, press Enter to stop: cat Enter a line of words, press Enter to stop: dog Enter a line of words, press Enter to stop: egg Enter a line of words, press Enter to stop: furniture Enter a line of words, press Enter to stop: There were 6 words Average word length 4.50
(18 points) Test cases
Case # | Description | Lines Input | Expected Outcome | |
---|---|---|---|---|
Input Lines | Number of words | Avg word length | ||
1. | One line, one word | bottle, Enter | ||
2. | One line, multiple words | Cat in the hat, Enter | ||
3. | Multiple Lines one word per line | the, largest, score, Enter | ||
4. | Multiple Lines multiple words per line | This is a test, only a test, of the Alert system, Enter | ||
5. | NO lines, just Enter | Enter |
(10 points) Design
(42 points) Implementation