Asked by Andre
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
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
Answers
Answered by
Graham
Well, beside the fact that the there's no indication of reading or writing anywhere...
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.
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.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.