CPS 108, Spring 2004, Read Performance Questions
Questions based on the code in
readperformance.cpp.
- Compare and contrast (at a high level) the methods used in
SimpleReader and RawReader to differentiate between
reading from a file and from standard input.
- In RawReader the methods readStdin and
readFile are private and both have the same last line. Explain
why they're private and how to avoid the code-duplication that stems
from that same last-line.
- Explain how to (simply) convert all words to lower case in the
SimpleReader class.
- Explain how to convert all words to lower case in the
RawReader class.
Owen L. Astrachan
Last modified: Fri Jan 23 12:40:37 EST 2004