Question: Please implement the following problem in basic C++ code and include detailed comments so that I am able to understand the processes for the solution.

Please implement the following problem in basic C++ code and include detailed comments so that I am able to understand the processes for the solution. Thanks in advance.

Please implement the following problem in basic C++ code and include detailed

// personType.h

#include

using namespace std; class personType { public: virtual void print() const; void setName(string first, string last); string getFirstName() const; string getLastName() const; personType(string first = "", string last = ""); protected: string firstName; string lastName; }; 

// personTypeImp.cpp

 #include  #include  #include "personType.h" using namespace std; void personType::print() const { cout  

// main.cpp

#include "extPersonType.h" #include  int main() { extPersonType myPerson = extPersonType("John", "Denver", 3 , addressType(" 42 W Warren Ave", "Wayne", "MI", "48202")); myPerson.print(); system("pause"); } 

Please be sure that the answer matches the shown sample output!

Define a class addressType, that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables Derive a class extPersonType from the class personType. Add a member variable to this class to classify the person as a family member, friend, or business associate. (Hint: you can use an Integer data type to save this information. For example, 1 for family member, 2 for friend and 3 for business associate) In addition, add a member variable to store the address (using address Type object). Add proper statements on in the main function to test you code. Use constructors to automatically initialize the member variables. Sample Output: CAWINDOWSlsystem321cmd.exe John Denver is a business associate who 1ives at 42 W Warren Ave, Wayne, MI 48202 Press any key to continue

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!