CSC 533: Organization of Programming Languages
Spring 2012

HW1: Java Programming


You may choose to work with one other person in the class for this assignment. If you do so, your team will submit only one assignment and the grade will be shared equally.


When they were separate departments, the Department of Journalism and the Department of Computer Science each maintained a contact list for alumni. Now that they are merged into one department, it wishes to merge these two alumni contact lists into one. You are to write a Java program that accomplishes this task.

Each alumni contact list is stored in a text file, with a four line entry for each alum. The first line is the alum's name: last name then first name. The next two lines contain the alum's email address and phone number. The fourth line contains the date (month, day, then year) that this contact information was reported. For example:

Smith Chris chris93827@wahoo.com 402-555-1234 5 20 2009

You may assume that one space separates the last name from the first name, and one space separates the numbers in the date. Otherwise, there will be no other spaces in the entries. Likewise, there are no blank lines between alumni entries in the file, e.g., the info for the first alum contact is on lines 1-4, the info for the second alum is on lines 5-8, etc. You may also assume that entries in each file are ordered alphabetically by name. For example, info for "Smith Chris" will appear before info for "Taylor Jamie" but after info for "Smith Alan".

Your program should prompt the user for the names of the two files containing the alumni lists, and write the merged file to a third file (whose name is also entered by the user). As before, the merged alumni contact info should be arranged in alphabetical order by name. Note that it is possible that the same person might appear in both lists. If that is the case, then the entry with the most recent date should be retained.

Grading Info

90% of the grade on this assignment is based on functionality. If it performs the task as specified, it will receive at least 90% credit. The remaining 10% is based on design and readability. You should design your solution with extensibility in mind. That is, if we wanted to process alumni lists in other ways (e.g., identifying classmates, adding major information, cross-listing with other departments), it should be easy to reuse parts of your code. Likewise, you should document your class and follow good style practices (e.g., meaningful variable names, consistent indentation).