Comp 151 Project 5

Copying a file


In this lab you will write a program to copy a text file into two other files a line at a time. You will have the opportunity to practice your loops and file reading and writing.

Due: Sunday Nov 7th at 11:59pm


This time you are given the freedom to design your program on your own under the constraints given below. There will be no UML to follow.

Your program must query the user about what file the user wants to copy, and what file name the user wants to copy the program to. Let us for example assume that the user has chosen to copy the file demo.txt and has chosen output.txt as their file name to copy to. Your program has to open demo.txt, and read it in. It need to open/create output.txt and write the contents of demo.txt to output.txt. Your program also needs to create another output file named as output-half.txt which will contain every other line of the input file (demo.txt) in this example.

Additinal restrictions:
To help you get in the habit of good program writing, I am imposing the following additional restrictions on your program.


again zip up your project folder and submit it to me by email. Make sure that your submitted zip file contains your first initial and last name as part of the zip file name.