Topical Information

This lab will give you practice using the String class we developed in lecture (as well as some more help with randomness and files).

Program Information

Allow the user the choice of displaying either a random line or a random word from a file they specify. Your menu should allow them to choose these options either from the number of the option or from the capitalized letter. For example,

    1) display random Word
    2) display random Line
    3) Quit

Should allow the user to select a random line display by either entering the number 2 or by entering a letter L (lower or upper case!).

Thought Provoking Questions

  1. How can you determine how many lines are in the file? How many words?

  2. Does the use of the String class ease this process? (i.e. Could you easily and accurately have counted the lines using Cstring's? What if their line were 1543 characters long? Okay, then how about 501145 characters long?)

  3. Might an index file help here? Would String objects help in generating the index file?

This assignment is (Level 2).