Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Question - 06
- #include <bits/stdc++.h>
- using namespace std;
- // ---( a )---
- class addressType {
- private:
- string street;
- string city;
- string state;
- int zip;
- public:
- addressType( string s, string c, string st, int z ) {
- street = s;
- city = c;
- state = st;
- zip = z;
- }
- string getStreet() {
- return street;
- }
- string getCity() {
- return city;
- }
- string getState() {
- return state;
- }
- int getZIP() {
- return zip;
- }
- void setStreet( string s ) {
- street = s;
- }
- void setCity( string s ) {
- city = s;
- }
- void setState( string s ) {
- state = s;
- }
- void setZIP( int k ) {
- zip = k;
- }
- void setAddress ( string s, string c, string st, int z ) {
- street = s;
- city = c;
- state = st;
- zip = z;
- }
- }
- // ---( b )---
- class extPersonType : public personType, public dateType, public addressType {
- private:
- string classification;
- string phoneNumber;
- public:
- extPersonType( string s1, string s2, int d, int m, int y, string cl, string phn ) : personType( s1, s2 ) {
- setDate( d, m, y );
- classification = cl;
- phoneNumber = phn;
- }
- void print() {
- std::cout << getFirstName() << " " << getLastName() << "\n" << classification << " \n" << phoneNumber << " ";
- std::cout << "\nDate Of Birth : " << getDay() << "-" << getMonth() << "-" << getYear() << "\n Address: ";
- std::cout << getStreet() << ", " << getCity() << ", " << getState() << ", " << getZIP << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement