Design a class named PersonData with the following member variables:
• lastName
• firstName
• address
• city
• state
• zip
• phone
Write the appropriate accessor and mutator functions for these member variables.
Next, design a class named CustomerData , which is derived from the PersonData class. The CustomerData class should have the following member variables:
• customerNumber - The customerNumber variable will be used to hold a unique integer for each customer. • mailingList - The mailingList variable should be a bool . It will be set to true if the customer wishes to be on a mailing list, or false if the customer does not wish to be on a mailing list.
The CustomerData class should also maintain a static variable to keep track of the total number of customers created and a static function to access that number.
Write appropriate accessor and mutator functions for these member variables. Demonstrate an object of the CustomerData class in a simple program.
#include <iostream>
#include <string>
using namespace std;
class PersonData
{
private:
string lastName;
string firstName;
string address;
string city;
string state;
string zip;
string phone;
public:
void setLastName(string newLastName);
void setFirstName(string newFirstName);
void setAddress(string newAddress);
void setCity(string newCity);
void setState(string newState);
void setZip(string newZip);
void setPhone(string newPhone);
string getLastName();
string getFirstName();
string getAddress();
string getCity();
string getState();
string getZip();
string getPhone();
};
void PersonData::setLastName(string newLastName)
{
lastName = newLastName;
}
void PersonData::setFirstName(string newFirstName)
{
firstName = newFirstName;
}
void PersonData::setAddress(string newAddress)
{
address = newAddress;
}
void PersonData::setCity(string newCity)
{
city = newCity;
}
void PersonData::setState(string newState)
{
state = newState;
}
void PersonData::setZip(string newZip)
{
zip = newZip;
}
void PersonData::setFirstName(string newFirstName)
{
firstName = newFirstName;
}
class CustomerData: public PersonData
{
public:
};
int main()
{
system("pause");
return 0;
}
I'm not really sure where to go from here. Any suggestions or tips would be awesome!