1. We run a small enterprise. Our employees have bank accounts at three online banks: iPKO, mBank and AliorBank with the unique bank identifiers 1020, 1140 and 2490 assigned, respectively.
The text file accounts.txt is given with a number of accounts unknown in advance. Each account is described in three lines containing in sequence: a bank account number of an employee in the IBAN format (described exactly below), the name of the employee and a salary, e.g.:
PL12 1140 6235 7851 3429 8357 9237 Smith
1234.56
The IBAN account numbers in Poland consist of the country prefix (PL) and then 26 digits, where the first two are the control sum digits (12 in the above example), next 4 digits identifies the bank (1140 in the above example), and the remaining ones form a unique account number in that bank.
The accountant expects lists containing account data separated for each bank and in the same order as in the original input file. Output files (if you have to create them) should be named 1020.txt, 1140.txt and 2490.txt, respectively. A single account must be written in three lines in form:
IBAN: PL12 1140 6235 7851 3429 8357 9237 Name: Smith
Salary: 1234.56
Tips: implement a structure modeling the input data for a single account and then use one of the abstract containers suitable for the task (from the standard library or implemented on your own).
2. Extend the program from task 1 to operate on any number of different banks (many bank identifiers). Change the order of accounts written to the resultant files to be ordered ascending by the name of the employee.