Problem 1: [10 points]
You are given two files: names1.dat and names2.dat. Each of these files contains some number of names in sorted order. You can assume that each file contains at least one name. The names within a file are distinct, but there may be names that appear in both files. Write a program that reads the names in both files, and produces a sorted list of distinct names obtained by ``merging'' the names in the two files. So for example, the contents of names1.dat may be:
and the contents of names2.dat may be:
The expected output is:
Problem 2: [10 points]
Solve Problems 6.15 and 6.17 from the Pause to reflect section on pages 289-290.