Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #include #include #include / / exit function prototype #include ClientData.h / / ClientData class definition using namespace std; void outputLine ( ostream& ,
#include
#include
#include
#include exit function prototype
#include "ClientData.h ClientData class definition
using namespace std;
void outputLine ostream& const ClientData & ; prototype
int main
ifstream inCredit "credit.dat", ios::in ios::binary ;
exit program if ifstream cannot open file
if inCredit
cerr "File could not be opened." endl;
exit EXITFAILURE ;
end if
output column heads
ClientData client; create record
int r;
cout "Enter record to read ;
cin r;
inCredit.seekg sizeofClientDatar ios::cur;
read first record from file
inCredit.read reinterpretcast char &client
sizeof ClientData ;
cout left setw "Account" setw
"Last Name" setw "First Name" left
setw right "Balance" endl;
outputLine cout, client ;
read next from file
#include
#include
#include
#include exit function prototype
#include "ClientData.h ClientData class definition
using namespace std;
void outputLine ostream& const ClientData & ; prototype
int main
ifstream inCredit "credit.dat", ios::in ios::binary ;
exit program if ifstream cannot open file
if inCredit
cerr "File could not be opened." endl;
exit EXITFAILURE ;
end if
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started