Lab 5

Due 1:30PM February 26, 2007

  1. Implement a program to open the file “dracula.txt”, count the number of lines on which the word “vampire” appears, and write the result to a new file. Your program will keep a count of the number of lines in the input file and produce an output file that contains the line number and line for each line on which the word appears. For example, if your program was counting the number of occurrences of the word "stormy", you might have the following entry in your output file to indicate that the word appears on line 5: "5: It was a dark and stormy night."


Sami Rollins