I won’t post a solution here, but I’ll give you enough to build one on your own:
To be able to handle files in C++, you must include the fstream library.
Then you can declare a file to be read from as ifstream myFile(NameOfYourFile).
If you want to declare a file to write to, you write ofstream myFile(NameOfYourFile)
You then need to check that the file was successfully opened using myFile.is_open().
At the end you need to close your file with myFIle.close().
Reading from a file can be done using the getline(myFile, line) command where line is a string variable.
I think that pretty much covers everything you need to know. If you need any more help, let us know.