24. Object-Oriented Programming:  Homework

Last revision:  April 15, 1998

Author: YourNameGoesHere

Write a package to implement a primitive word processor, where a "document" is a list of strings which we think of as lines of the document.  You should provide functions to erase the document (set the document to an empty list), print the document (by executing "Print[string]" for each string in the document), insert strings into the document at a specific place, delete a specific numbered string from the document, and tell how many lines the document has.

Here is some sample input and output your package should support.  (Note that the functions have been chosen with particular names, to which you are not bound.)

lenDoc[]

addLine["Hello",1]

printDoc[]

addLine["Line 1",1]

printDoc[]

delLine[1]

printDoc[]

lenDoc[]

addLine["Last Line",2]

printDoc[]