Find the bugs mod 7.docx - Find the bugs Chapter 7 1 Each...

This preview shows page 1 - 3 out of 6 pages.

Find the bugsChapter 71) // Each time a salesperson sells a car at the// Pardeeville New and Used Auto Dealership,// a record is created containing the salespersons// name and the amount of the sale.// Sales of new and used cars are kept in separate files,// sorted by salesperson ID number.// Management has requested a merged file so that// all of a salespersons sales (both new and used cars)// are displayed together. The following code is intended// to merge the files.startDeclarationsstring newSalespersonnum newAmountstring usedSalespersonnum usedAmountstring bothAtEof = "N"string HIGH_NAME = "ZZZZZ"InputFile newSalesInputFile usedSalesOutputFile allsalesgetReady()while bothAtEof = "N"detailLoop()endwhilefinish()stop getReady()open newSales "NewSales.dat"open usedSales "UsedSales.dat"open allSales "AllSales.dat"input newSalesperson, newAmount from newSalesif eof thennewSalesperson = HIGH_NAMEendifinput usedSalesperson, usedAmount from usedSalesif eof thenusedsalesPerson = HIGH_NAMEendif

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture