Question: int Composition Defi ne a Person class that has the following private data members: a string to store the rson's name, an integer to store

 int Composition Defi ne a Person class that has the following

int Composition Defi ne a Person class that has the following private data members: a string to store the rson's name, an integer to store the number of vehicles, and a dynamically-allocated array of Vehicle objects. Be sure your class has the appropriate constructors accessor functions, and mutator functions, as well as a copy constructor, a destructor and an assignment operator (which we need because the class contains a pointer to dynamically-allocated memory). Define a Vehicle class that has private data member to store the type of vehicle (such as "bike", "car, "motorcycle', etc.) as a string. Create the appropriate constructors, accessor functions, and mutator functions for the class. Write an application that satisfies the following requirements: Write a local function, void printPersonInfo (Person p), to print the information about a Person. This will print the Person's data members and Vehicle types. . In main(): Create a Person object. Ask the user for the information to set the data members for the Person. Create the dynamically-allocated array of Vehicle objects for the Person. Ask the user for the information to set all the Vehicle types. Call printPersonInfo() to print the person information with vehicle names. o o o o o exson Pnjake

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!