Realizing reading and writing data from or to file. Task from lesson4 is realized here