Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The willmington Walking Club maintains a master file that contains a record for

ID: 3626785 • Letter: T

Question

The willmington Walking Club maintains a master file that contains a record for each of its members. Fields in the master file include the walkers ID number, first name, last name, and total miles walked to the nearest one-tenth of a mile. Every week, a transaction file is produced. it contains a walkers id number and the number of miles the walker has logged that week. each file is sorted in the walker id number order. design the logic for a program that matches the master and transaction file records and updates the total miles walked for each club member by adding the current weeks miles to the cumulative total. not all walkers submit walking reports each week. the out put is the updates master file and an error report that lists any transaction records for which no master record exists

Explanation / Answer

Dear User, Pseudocode: Start Declarations InputFile masterFile InputFile transactionFile OutputFile UpdatedMasterFile Num Walkerid String walkerFName String walkerLName Num totalMiles Num numberOfMiles Num END_NUM=9999 String bothAtEnd=”N” Update() While bothAtEnd”Y” updateMasterRecords() endwhile finishup() Stop Update() Open master file”MaterFile.dat” Open transaction file “TransactionFile.dat” Open updatedMasterFile “updatedMasterFile.dat” readMaster() readTrans() checkEnd() return readMaster() input masterWalkerid,WalkerFname input WalkerLName num totalMiles from materFile while eof totalMiles=END_NUM return readTrans() input TransactionWalkerid num numberOfMiles while eof numberOfMiles=END_NUM return checkEnd() if totalMiles==END_NUM if numberOfMiles=END_NUM bothAtEnd=”Y” endif endif return updateMasterRecords() if masterTransactionid=TransactionWalkerid totalMiles=totalMiles+numberOfMiles output masterWalkerid,WalkerFname, WalkerLName,totalMiles to UpdatedMasterFile readMaster() readTrans() else if masterTransactionid>TransactionWalkerid output masterWalkerid,WalkerFname, WalkerLName,totalMiles to UpdatedMasterFile readMaster() else output “No Master Record found for transaction id”, masterTransactionid to UpdatedMasterFile readTrans() endif endif checkEnd() return close finishup() master file transaction file updatedMasterFile