Home Segments Top Top Previous Next

553: Practice

Typing in data is tedious; even skilled typists make mistakes. Accordingly, suppose that you decide to have two typists independently create files for your baseball team's season record. Assume that both typists use the format shown in Segment 502.

Next, you write two methods: readScores and verifyScores. The readScores method is to take a filename argument and to return a two-dimensional array of the sort you learned about in Segment 535. The verifyScores method is to take two arguments: a file name and the array produced by readScores. The verifyScores method is to display information about every score for which the two files differ, and to return true only if there are no discrepancies.