expand icon
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

Edition 7ISBN: 1285225562
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

Edition 7ISBN: 1285225562
Exercise 19

The Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patient’s first and last name, home address, and birth year. The records are sorted in ascending birth year order. Two doctors, Dr. Best and Dr. Cushing, have formed a partnership. Design the logic that produces a merged list of their patients in ascending order by birth year.

Step-by-step solution
Verified
like image
like image

Step 1 of 14

Pseudo code:

The following is the required pseudo code to merge the records of the two files of Dr. Best and Dr. Crushing. The records are merged and the list is generated in ascending order based on patients’ birth year.

start

Declarations

InputFile drBestFile

InputFile drCushingFile

ouputFile mergedFile

string bestFirstName

string bestLastName

string bestHomeAddress

num bestBirthYear

string cushingFirstName

string cushingLastName

string cushingHomeAddress

num cushingBirthYear

string END_NAME = “ZZZZZZ”

string bothFilesAtEnd = “N”

getReady()

while bothFilesAtEnd <> “Y”

mergeRecords()

endwhile

finishUp()

stop


Step 2 of 14


Step 3 of 14


Step 4 of 14


Step 5 of 14


Step 6 of 14


Step 7 of 14


Step 8 of 14


Step 9 of 14


Step 10 of 14


Step 11 of 14


Step 12 of 14


Step 13 of 14


Step 14 of 14

close menu
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
cross icon