Dartmoor medical associates maintains two patient

This preview shows page 22 - 29 out of 45 pages.

4. Dartmoor Medical Associates maintains two patient files—one for the Lakewood office and one for the Hanover office. Each record contains the name, address, city, state, and zip code of a patient, with the file maintained in zip code order. Write the flowchart or pseudocode that merges the two files to produce one master name and address file that the Dartmoor office staff can use for addressing the practice’s monthly Healthy Lifestyles newsletter mailing in zip code order.
mainLoop( ) if hanZip < lakeZip then write hanName, hanAdd, hanCity, hanState, hanZip perform readHanover( ) else write lakeName, lakeAdd, lakeCity, lakeState, lakeZip perform readLakewood( ) endif if lakeZip = 99999 then if hanZip = 99999 then bothDone = "Y" endif endif return finishUp( ) close files return
Flow chart:
5. The Willmington Walking Club maintains a master file that contains a record for each of its members. Fields in the master file include the walker’s ID number, first name, last name, and total miles walked to the nearest one-tenth of a mile. Every week, a transaction file is produced; the transaction file contains a walker’s ID number and the number of miles the walker has logged that week. Each file is sorted in walker ID number order. a. Create the flowchart or pseudocode for a program that matches the master and transaction file records and updates the total miles walked for each club member by adding the current week’s miles to the cumulative total for each walker. Not all walkers submit walking reports each week. The output is the updated master file and an error report listing any transaction records for which no master record exists.
mainLoop( ) if transWalkNumber = walkNumber then walkTotalMiles = walkTotalMiles + transMiles perform readWalk( ) perform readTrans( ) else if transWalkNumber > walkNumber then write walkRec perform readWalk( ) else print "An error has occurred" print "There is no master record for walker ", transWalkNumber perform readTrans( ) endif endif if transWalkNumber = 999 then if walkNumber = 999 then bothDone = "Y" endif endif return finishUp( ) close files return
Flowchart:

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture