read text files

icon picker
Scottish voters

read a text file, store as integer values, find max, count occurrences
@council voters
(number values in a text file)
145832\n192269\n86548\n65512\n343748(EndOfFile)
The key file operations are required:
open a file
read from a file
close a file
Examine the text file, it contains the number of voters in all 32 Scottish Councils.
Each number is displayed on a new line.
Examine the code.
Compare the code with the description in codeClips.
Make sure you know what code is used to open, read and close the file.

Challenges

What is the largest number of voters?
How many councils have more than 100000 voters?

Loading…
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.