2. Boardman College maintains two files—one for Sociology majors and another for Anthropology majors. Each file contains students' ID numbers, last names, first names, and grade point averages. Each file is in student ID number order. The college is merging the two departments into a Department of Sociology and Anthropology. Design the logic for a program that merges the two files into one file containing a list of all students, maintaining ID number order.

To design a program that merges the two files into one file containing a list of all students, maintaining ID number order, you can follow these steps:

1. Open the Sociology file for reading and create a temporary file to store the merged data.
2. Read the first record from the Sociology file and store it in a temporary variable.
3. Open the Anthropology file for reading.
4. Read the first record from the Anthropology file.
5. Compare the ID numbers of the current records from both files.
6. If the ID number from the Sociology file is smaller, write the record from the Sociology file to the temporary file and read the next record from the Sociology file.
7. If the ID number from the Anthropology file is smaller, write the record from the Anthropology file to the temporary file and read the next record from the Anthropology file.
8. If the ID numbers are equal, merge the data and write it to the temporary file. Read the next record from both files.
9. Repeat steps 5-8 until you reach the end of either file.
10. If there are any remaining records in the Sociology file, write them all to the temporary file.
11. If there are any remaining records in the Anthropology file, write them all to the temporary file.
12. Close both input files and the temporary file.
13. Rename the temporary file to the desired output file, which will now contain the merged data in ID number order.

Here's the logic in pseudocode:

```
Open the Sociology file for reading
Create a temporary file for merging

Read the first record from the Sociology file
Open the Anthropology file for reading
Read the first record from the Anthropology file

While not reached the end of either file:
If Sociology record ID < Anthropology record ID:
Write Sociology record to the temporary file
Read the next record from the Sociology file
Else if Anthropology record ID < Sociology record ID:
Write Anthropology record to the temporary file
Read the next record from the Anthropology file
Else (ID numbers are equal):
Merge the data and write it to the temporary file
Read the next record from both files

While not reached the end of the Sociology file:
Write remaining Sociology records to the temporary file
Read the next record from the Sociology file

While not reached the end of the Anthropology file:
Write remaining Anthropology records to the temporary file
Read the next record from the Anthropology file

Close the Sociology file
Close the Anthropology file
Close the temporary file

Rename the temporary file to the desired output file

End of program
```

By following this logic, you will be able to merge the two files into one file containing a list of all students, while maintaining the ID number order.