Find the highest score in the results file

After the judges rate the competitors, the scores are stored in a file called results . txt. There is one line in the file for each competitor's score. You need to write a program that reads through each of these lines, picks out the score, and then works out the highest score in the Surf-A-Thon.

Results are stored m

Results are stored m

It sounds simple enough, except for one small detail. You've written programs to read data from the Web, and read data that's been typed in at the keyboard, but you haven't yet written any code that reads data stored in a file.

shredding with the for loop

Was this article helpful?

0 0

Post a comment