Write a series of statements that accomplish each of the following. Assume that we’ve defined class Person that contains the private data members
char lastName[ 15 ];char firstName[ 10 ];int age;int id;
and public member functions
// accessor functions for idvoid setId( int );int getId() const;// accessor functions for lastNamevoid setLastName( const string&);string getLastName() const;// accessor functions for firstNamevoid setFirstName( const string&);string getFirstName() const;// accessor functions for agevoid setAge( int );int getAge() const;
Also assume that any random-access files have been opened properly.
a) Initialize nameage.dat with 100 records that store values lastName ="unassigned", firstName = "" and age = 0.
b) Input 10 last names, first names and ages, and write them to the file.
c) Update a record that already contains information. If the record does not contain information, inform the user "No info".
d) Delete a record that contains information by reinitializing that particular record.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.