read text files

icon picker
Scottish Council voters

read 2 text files, store as text and integer values, find max, count occurrences, use substring
@council voters

file values


(number values in a text file)
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

Display the name and voters for the largest council (most voters) and the smallest council (least voters)
How many councils are in the Lothians and Edinburgh? How many voters all together?
How many councils are in all of Ayrshire? How many voters all together?

project code

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.