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

A walking club maintains a master file that contains a record for each of its me

ID: 3627136 • Letter: A

Question

A walking club maintains a master file that contains a record for each of its members. Fields in the master file include the walker's 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 walker's ID number and the number of miles the walker logged that week. Design logic for a program that matches master and transaction file records and updates the total miles walked for each club member by adding to the cumulative total. Not all walkers submit walking reports each week. The output is updated 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
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote