Question: Need help with this c++ program using methods provided in the statement. Release date: October 24, 2018 Due date: October 31, 2018 Given struct clientData

Need help with this c++ program using methods provided in the statement.

Need help with this c++ program using methods provided in the statement.

Release date: October 24, 2018 Due date: October 31, 2018 Given struct

Release date: October 24, 2018 Due date: October 31, 2018 Given struct clientData ( int accountNumber; char lastNamel 15 ]; char firstNamel 10 ]: float balance; Create a random access file of 100 records named "credit.dat" using these code segments: ofstream outCredit( "credit.dat", ios::out); clientData blankClient (0,0.0); for ( int i 0, i (&blankClient ), sizeofi clientData) ) member function write The costream> member function write outputs a fixed number of bytes beginning at a specific location in memory to the specific stream. When the stream is associated with a file, the data is written beginning at the location in the file specified by the "put" file pointer. The write function expects a first argument of type const char *, hence use the reinterpret cast to convert the address of the blankClient to a const char The second argument of write is an integer of type size_t specifying the number of bytes to written. Thus the use of sizeoff clientData ). Next- write data into the file clientData client ofstream outCrediti( "credit.dat", ios:ate ); //ios::ate access anywhere user enters an account number (valid range 1 to 100, 0 to end input) user enters client.lastname, client.firstname, client.balance outCredit1.seekpf (client.accountNumber -1) sizeofl clientData) ); outCredit1. writel reinterpret_castconst char >( &client ), sizeoff clientData))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!