if eof then employeeId ENDID endif return readTrans input transemployeeId

If eof then employeeid endid endif return readtrans

This preview shows page 4 - 7 out of 7 pages.

if eof then employeeId = END_ID endif return readTrans() input transemployeeId, transaddress, transhourlyRate, transFirstName, transLastName, transGrossPay from transFile if eof then transemployeeId = END_ID endif return checkEnd() if masteremployeeId = END_ID then if transemployeeId = END_ID then areBothAtEnd = “Y” endif endif return updateRecords() if transemployeeId = masteremployeeId then output masteremployeeId, masterFirstName, masterLastName, masterTotal to updatedFile readMaster() readTrans() else if transId > masterId then output masteremployeeId, masterFirstName, masterLastName, masterGrossPay, masterHourlyRate to updatedFile readMaster() readTrans()else output “No master record for transaction ”, transEmployeeId readTrans() endif endif checkEnd() return finishUp() close masterFile close transFile close updatedFile return 7C
startstart Declarations InputFile masterFile InputFile transFile OutputFile updatedFile num employeeId string employeeFirstName string employeeLastName num address num hourlyRate num transTotalnum grossPay string areBothAtEnd= “N” num END_ID = 999 getReady() while areBothAtEnd <> “Y” updateRecords() endwhile finishUp() stop getReady() open masterFile “TimelyTalentTemp.txt” open transFile “TimelyTalentTempTransactions.txt” open updatedFile “UpdatedEmployees.txt” readMaster() readTrans() checkEnd() return stopgetReady() open masterFile “TimelyTalentTemp.txt” open transFile “TimelyTalentTempTransactions.txt” open updatedFile “UpdatedEmployees.txt” readMaster() readTrans() checkEnd() return readMaster()read mRecif eof thenmasterEmployeeId = 9999endifreturnreadTrans( )read tRec
if eof thentransEmployeeId = 9999endifreturnmainLoop( )if masteremployeeId < transemployeeId thenperform readMaster( )elseif mId = tId thentotalHours = totalHours + transHoursperform readTrans( )elseprint "Employee", transEmployeeId, "not in Employee Master file" perform readTrans( )endifendifif mId = 9999 thenif transemloyeeId = 9999 thenbothDone = "Y"endifendifreturnfinishUp( )close filesreturn

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture