Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include <iostream> using namespace std; class PersonData { private: string last

ID: 3805882 • Letter: #

Question

#include <iostream>

using namespace std;

class PersonData
{
private:
string lastname;
string firstname;
string address;
string city;
string State;
int zip;
int phonenumber;
public:
void setlastname(string l)
{
lastname = l;
}
void setfirstname(string f)
{
firstname = f;
}
void setaddress(string a)
{
address = a;
}
void setcity(string c)
{
city = c;
}
void setState(string S)
{
State = S;
}
void setzip(int z)
{
zip = z;
}
void setphonenumber(int p)
{
phonenumber = p;
}
string getlastname()
{
return lastname;
}
string getfirstname()
{
return firstname;
}
string getaddress()
{
return address;
}
string getcity()
{
return city;
}
string getState()
{
return State;
}
int getzip()
{
return zip;
}
int getphonenumber()
{
return phonenumber;
}

};
class Customerclass: public PersonData
{
private:
int customernumber;
bool mailinglist;
public:
void setcustomernumber(int );
void setmailinglist(bool );
int getcustomernumber();


};
void Customerclass::setcustomernumber(int customer)
{

cout << "Enter a member Id: Example 7654357 " << endl;
cin >> customer;
customernumber = customer;

}
void Customerclass::setmailinglist(bool Mail)
{
mailinglist = Mail;
string yesorno;


cout << "Would you like to be on the Mailing list? Enter (Yes or No:)" << endl;
cin >> yesorno;
if(yesorno == "Yes" || yesorno == "yes")
{
cout << "You are part of the mailing list: " << endl;
Mail = true;
}
else
{
cout << "Your not on the Mailing list: " << endl;
Mail = false;

}


}
int Customerclass::getcustomernumber()
{
return customernumber;
}

int main()
{

Customerclass Y;
string LASTNAME;
string FIRSTNAME;
string ADDRESS;
string CITY;
string STATE;
int ZIP;
int PHONE;
int CustomerID;
bool trueorfalse;

Y.setmailinglist(trueorfalse);


cout << "Enter Lastname: " << endl;
getline(cin, LASTNAME);
cin.ignore();
cout<< "Enter Firstname: " << endl;
getline(cin, FIRSTNAME);
cin.ignore();
cout << "Enter Address: " << endl;
getline(cin, ADDRESS);
cin.ignore();
cout << "Enter City: " << endl;
getline(cin, CITY);
cin.ignore();
cout << "Enter State: " << endl;
getline(cin, STATE);
cin.ignore();
cout << "Enter Zip code: " << endl;
cin >> ZIP;
cout << "Enter Phone number: " << endl;
cin >> PHONE;
Y.setlastname(LASTNAME);
Y.setfirstname(FIRSTNAME);
Y.setaddress(ADDRESS);
Y.setcity(CITY);
Y.setState(STATE);
Y.setzip(ZIP);
Y.setphonenumber(PHONE);
Y.setcustomernumber(CustomerID);
cout << "Customer ID: " << Y.getcustomernumber() << endl;
cout << "First and last name: " << Y.getfirstname() << " " << Y.getlastname() << endl;
cout << "Address: " << Y.getaddress() << " " << Y.getcity() << " " << Y.getState() << " " << Y.getzip() << endl;
cout << "Phone number: " << Y.getphonenumber() << endl;

return 0;
}

*********************PersonData and Customer Data 1. 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. CS 2 – Fall 2016 E. Ambrosio 2 Next, design a class named CustomerData, which is derived from the PersonData class. The CustomerData class should have the following member variables: customerNumber mailingList The customerNumber variable will be used to hold a unique integer for each customer. The mailingList variable should be a boolean. 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. Write appropriate accessor and mutator functions for these member variables. Finally, demonstrate an object of the CustomerData class in a simple program

Help my program is not working!!!!!!!!!!!!!!!!!!!! C++

Explanation / Answer

#include using namespace std; class PersonData { private: string lastname; string firstname; string address; string city; string State; int zip; int phonenumber; public: void setlastname(string l) { lastname = l; } void setfirstname(string f) { firstname = f; } void setaddress(string a) { address = a; } void setcity(string c) { city = c; } void setState(string S) { State = S; } void setzip(int z) { zip = z; } void setphonenumber(int p) { phonenumber = p; } string getlastname() { return lastname; } string getfirstname() { return firstname; } string getaddress() { return address; } string getcity() { return city; } string getState() { return State; } int getzip() { return zip; } int getphonenumber() { return phonenumber; } }; class Customerclass: public PersonData { private: int customernumber; bool mailinglist; public: void setcustomernumber(int ); void setmailinglist(bool ); int getcustomernumber(); }; void Customerclass::setcustomernumber(int customer) { cout