Here is the question

The Redgranite Library keeps a file of all books borrowed every month. Each file is in Library of Congress number order and contains additional fields for author and title.

a. Design the logic for a program that merges the files for January and February to create a list of all books borrowed in the two-month period.

I am doing ok with basic coding, but I am confused when it comes to merging files and checking properly for eof...below is the pseudo code (as bad as it is and probably wrong all together) that I have so far...any guidance would be greatly appreciated

start
declarations
InputFile January
InputFile February
OutputFile TwoMonth
string janLOCnum
string janAuthor
string janTitle
string febLOCnum
string febAuthor
string febTitle
string end_num = “zzzzzzzzzz”
string bothAtEnd = “N”
readjan()
readfeb()

while bothAtEnd <> “Y”
mergRecords()
endwhile

closefile()
stop

readjan()
read January
get janLOCnum, janAuthor, janTitle

readfeb()
input February
get febLOCnum, febAuthor, febTitle

.mergRecords()
If janLOCnum < febLOCnum
then
output janLOCnum, title, author
readjan()
else
output febLOCnum, title, author
readfeb()

endif

side note, this only has to be pseudo code not an actual working program...