7a Pseudocode start Declarations InputFile masterFile InputFile transFile

7a pseudocode start declarations inputfile masterfile

This preview shows page 2 - 5 out of 6 pages.

7a. Pseudocode: start Declarations InputFile masterFile InputFile transFile OutputFile updatedFile num masterId string masterFirstName string masterLastName num masterTotal num transId num transTotal string transService string areBothAtEnd = “N” num END_ID = 999 getReady() while areBothAtEnd <> “Y” updateRecords() endwhile finishUp() stop getReady() open masterFile “ CurlUpAndDyeMaster .txt” open transFile “ CurlUpAndDyeTransactions .txt” open updat edFile “UpdatedClients.txt” readMaster() readTrans() checkEnd() return readMaster() input masterId, masterFirstName, masterLastName, masterTotal from masterFile
if eof then masterId = END_ID endif return readTrans() input transId, transService, transTotal from transFile if eof then transId = END_ID endif return checkEnd() if masterId = END_ID then if transId = END_ID then areBothAtEnd = “Y” endif endif return updateRecords() if transId = masterId then masterTotal = masterTotal + transTotal output masterId, masterFirstName, masterLastName, masterTotal to updatedFile readMaster() readTrans() else if transId > masterId then output masterId, masterFirstName, masterLastName, masterTotal to updatedFile readMaster() else outp ut “No master record for transaction ”, transId readTrans() endif endif checkEnd() return finishUp() close masterFile close transFile close updatedFile return 7b. Flowchart: (Only the modules that have changed from part a are shown below)
7b. Pseudocode: start Declarations InputFile masterFile InputFile transFile OutputFile updatedFile num masterId

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture