CSIS 119 Exam 7 - 1 Grossmont College maintains a master...

This preview shows page 1 - 2 out of 4 pages.

1)// Grossmont College maintains a master file of students and credits earned.// Each semester the master is updated with a transaction file// that contains Student ID and credits earned during the semester.// Each file is sorted in Student ID number order. Student name only exists in the master file.startDeclarationsnum masterIDstring masterNamenum masterCreditsnum transIDstring bothDone = "N"num HIGH_VALUE = 999999InputFile masterInputFile transOutputFile newMastergetReady()while bothDone = "N"detailLoop()endwhileallDone()stopgetReady()open master "studentFile.dat"open transaction "semesterCredits.dat"open newMaster "updatedStudentFile.dat"readMaster()readTrans()checkBoth()returnreadMaster()input masterID, masterName, credits from masterif eof thenmasterID = HIGH_VALUEendifreturnreadTrans()input transID, transCredits from transif eof thentransID = HIGHendifreturncheckBoth()if masterID = HIGH_VALUE OR transID = HIGH_VALUE thenbothDone = "Y"endifreturndetailLoop()if masterID = transID thenmatch()elseif masterID > transID thennoMasterForTrans()elsenoTransForMaster()

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture