trying to debug pseudocode
2. Th e Springwater Township School District has two high
schools—Jeff erson and Audubon. Each school maintains a
student fi le with fi elds containing student ID, last name, fi rst
name, and address. Each fi le is in student ID number order.
Design the logic for a program that merges the two fi les
into one fi le containing a list of all students in the district,
maintaining student ID number order.
start
Declarations
InputFile customerData
OutputFile mailingLabels
string studentid
string firstName
string LastName
string streetAddress
housekeeping( )
while bothDone = "N"
mainLoop( )
endwhile
finishUp( )
stop
housekeeping( )
open customerData "VernonHillsMailOrderBoxes.txt"
open mailingLabels "CutomerMailingLabels.txt"
Jefferson( )
Audubon( )
if jeffId = 9999 then
if audId = 9999 then
bothDone = "Y"
endif
endif
return
Jefferson( )
if eof then
jeffId = 9999
endif
return
Audubon( )
if eof then
audId = 9999
endif
return
mainLoop( )
if jeffId > audId then
Audubon( )
else
Jefferson( )
endif
if jeffId = 9999 then
if audId = 9999 then
bothDone = "Y"
endif
endif
return
finishUp( )
close files
return
1 answer
The program's goal is to sort-merge two files into one, yet the program opens only one input file (and one output file). The program cannot accomplish the goal; it will not do what it's supposed to do.