Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

#include <iostream>

#include<string>

using namespace std;


class Name{
string first_name;
string Mid_name;
string last_name;
public:
Name(string a,string b,string c)
{
first_name=a;
Mid_name=b;
last_name=c;
}

void display()
{
cout<<"NAME-"<<first_name;
cout<<" "<<Mid_name;
cout<<" "<<last_name<<endl;
}

};
class Address{
string st_name;
int st_number;
public:
Address(string d,int e)
{
st_name=d;
st_number=e;
}
void display()
{
cout<<"ADDRESS-"<<st_number<<st_name<<endl;
}
~Address(){}
};
class CreditCardHolder
{
Name name;
Address adr;
float monthly_payment;
public:
CreditCardHolder()
{
name("0","0","0")
adr("0",0)
monthly_payment=0;
}
CreditCardHolder(string a,string b,string c,string d,int e,float f)
{
name(a,b,c);
adr(d,e)
monthly_payment=f;
}
void Display()
{
cout<<"SALARY-"<<monthly_payment<<endl;
}
~CreditCardHolder(){}
};

int main()
{
string b,c,d,e;
int f;
float g;
cin<<b,c,d,e,f,g;
CreditCardHolder a(b,c,d,e,g,f);
}

You might also like