Return to the Index of Readings and Problems Sets
Assigned Reading
Additional Reference Material
Exercise
After completing the reading and getting a feel for C++ STL and Java's container collections, please write a program that satisfies the following requirements.The program should be written in either C++ or Java. It should rely on the data structures and algorithms provided by C++'s STL or Java's Collections framework as much as is possible -- do not rewrite functionality provided by the framework.
Where multiple containers can be used to solve the problem, make good choices. For example, first, minimize your coding time, then, second, minimize computational time, lastly minimize storage space.
Requirements:
- The program should read in a list of student names from the file students.txt, one name per line
- The program should read in a list of teacher names from the file teachers.txt, one name per line
- The program should assign the students, one student at a time, round robin, to each teacher.
- The program should print out a listing of students by teacher. Teachers should be processed in alphabetical order. For each, students should be listed in reverse alphabetical order.
- Names are strings, last name first. For example, "Fink, Eugene"
- There will be no more than 100,000 students and no more than 2,000 teachers.