Notes from C++ Primer File State Condition state is used to manage stream state, which indicates if the stream is available or recoverable. State of stream is descripted by three member function: bad, fail, eof and good. bad(): unrecoverable error. I…