Return readgerard input gerardnum gerardlastname

This preview shows page 3 - 7 out of 11 pages.

return readGerard() input gerardNum, gerardLastName, gerardAddress, gerardArea from gerardFile if eof then gerardNum = END_NUM endif return checkEnd() if geraldineNum = END_NUM then if gerardNum = END_NUM then areBothAtEnd= “Y” endif endif return mergeRecords() if geraldineNum < gerardNum then output geraldineNum, geraldineLastName, geraldineAddress, geraldineArea to mergedFile readGeraldine() else
4, 2018 [ ASSIGNMENT #7 ] Place your name here output gerardNum, gerardLastName, gerardAddress, gerardArea to mergedFile readGerard() endif checkEnd() return finishUp() close geraldineFile close gerardFile close mergedFile return 3a. Laramie Park District has files of participants in its summer and winter programs this year.  Each file is in participant ID number order and contains additional fields for first name, last  name, age, and class taken (for example, Beginning Swimming). a.  Design the logic for a program that merges the files for summer and winter programs to  create a list of the first and last names of all participants for the year in ID number order. Answer: A sample solution follows Flowchart:
4, 2018 [ ASSIGNMENT #7 ] Place your name here Pseudocode: start Declarations
4, 2018 [ ASSIGNMENT #7 ] Place your name here InputFile summerFile InputFile winterFile OutputFile mergedFile num summerId num summerAge string summerFirst string summerLast string summerClass num winterId num winterAge string winterFirst string winterLast string winterClass string areBothAtEnd= “N” num END_ID = 999999 getReady() while areBothAtEnd <> “Y” mergeRecords() endwhile stop getReady() open summerFile “LaramieParkDistrictSummer.txt” open winterFile “LaramieParkDistrictWinter.txt” open mergedFile “LaramieParkDistrict.txt” readSummer() readWinter() checkEnd() return readSummer() input summerId, summerFirst, summerLast, summerAge, summerClass from summerFile if eof then summerId = END_ID endif return readWinter() input winterId, winterFirst, winterLast, winterAge, winterClass from winterFile if eof then

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture