Start perform housekeeping while bothdone n perform

This preview shows page 11 - 15 out of 15 pages.

startperform housekeeping ()while bothDone = “N”perform mainLoop ()perform finishLoop()stophousekeeping ()declare variablesopen filesperform readMaster()perform readTrans()if masterId = 9999 thenif transId = 9999 thenbothDone = “Y”endifendifreturnreadMaster()readMasterRecif eof thenmid = 9999endifreturnreadTrans ()read transRecif eof thentransId = 9999endifreturnmainLoop ()if masterId < transId thenperform readMaster()elseprint “Employee”, transID, “not in Employee Master file”, transJob
perform readTrans()endifendifreturnfinishUp ()close filesreturnB. Modify the help agency program to output lines only for workers who have completed atleast one job during the current week.startperform housekeeping ()while bothDone = “N”perform mainLoop ()perform finishLoop()stophousekeeping ()declare variablesopen filesperform readMaster()perform readTrans()if masterId = 9999 thenif transId = 9999 thenbothDone = “Y”endifendifreturnreadMaster()readMasterRecif eof thenmid = 9999endifreturnreadTrans ()read transRecif eof thentransId = 9999endifreturnmainLoop ()if masterId < transId thenperform readMaster()elseif masterId = transId thenprint transJob, masterId, transHours, masterRate, transHours * masterRateperform readTrans()
elseprint “Employee”, transId, “not in Employee Master file”, tranJobperform readTrans ()endifendifif mid = 9999 thenif transID = 9999 thenbothDone = “Y”endifendifreturnfinishUp ()close filesreturnC.Modify the help agency program so that any temporary worker can work any number ofseparate jobs during the week. Output one line for each job that week.startperform housekeeping()while bothDone = “N”perform mainLoop()perform finishUp()stophousekeeping ()declare variablesopen filesperform readMaster ()perform readTrans()saveId = transldif masterId = 9999 thenif transId = 9999 thenbothDone = “Y”endifendifreturnreadMaster ()read masterRecif eof thenmid = 9999endifreturnreadTrans( )read transRecif eof then
transId = 9999endifreturnmainLoop()if transId not = saveId thenprint saveId, totalHours, saveRate, totalHours * saveRatetotalHours = 0endifif masterId < transId thenperform readMaster()elseif masterId = transId thentotalHours = totalHours + totalHourssaveId = transIdperform readTrans()elseprint “Employee “, transId, “not in Employee Master file” transJobperform readTrans()endifendifif mid = 9999 thenif transId = 9999 thenbothDone = “YendifendifreturnfinishUp()close filesreturn

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 15 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Input output, outputfile mergefile

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture