As I look at your program I see you went to the trouble of opening and reading four variables from the file. But you only use two of the variables read and do nothing withe the other two or the rest of the line.
Lines 16 and 17 ask for user input. But what happens if the user enters a lower case letter? You could use he function "toupper(choice)" either after line 17 or in the if statements. Another alternative is to add an || to the if statements to check for a lower case letter. http://www.cplusplus.com/reference/cctype/toupper/?kw=toupper
This comes from the "<cctype>" header file. And I noticed that you are missing "<string>" header file.
Beyond that I would have to load the program and see what happens.
After working with he program I found that after adding the "<string>" and "<cctype>" header files, the toupper function worked best following line 17.
I could not duplicate or find any other problem with your code except that you are not fully using the file that you are reading.
you are not fully using the file that you are reading.
@Handy Andy, I think you got the point, besides all other errors. I think the original post contains the real code... I mean: it’s not a simplified version, the OP is actually not looping throughout the file.