Problem

Write a series of statements that accomplish each of the following. Assume that we’ve defi...

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.

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 14
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT