Lab 11: File Input/Output

Purpose

The purpose of this assignment is to give you practice reading from and writing to files.

Partners

You are encouraged to work with one other partner on this assignment.

Preliminaries

Create a BlueJ project named lab11 on your lab computer. Place the following files into this project:

It will also be useful to place the sample input files below (languages1.txt, languages2.txt) into this same directory.

Assignment

Supply the missing merge method in the MergeFiles class. The merge method can assume that each of the two files to be merged is in sorted, alphabetical order and contains one word per line. The merge method should produce an output file named lab11.out that contains all of the words in the two input files and is in sorted, alphabetical order with one word per line.

Sample Input Files

Sample Output File

Hints and Assumptions

Submission

Before your lab section finishes, e-mail your lab TA the MergeFiles.java file in an e-mail with the following subject line: CS 160, Lab 11, your name, your partner's name.

Grading - 10 points possible

Before Lab Ends

Please remember to delete the lab11 directory that you created and empty the recycle bin on your desktop. Thanks.

Valid XHTML 1.0!