#include<iostream>
#include<conio.h>
using namespace std;
class house
{
public :
char name[30], area[40],owner[30],address[50];
house()
{
cout<<"Enter House Name : ";
gets(name);
cout<<"Enter Area : ";
gets(area);
cout<<"Enter Owner Name : ";
gets(owner);
cout<<"Enter Address : ";
gets(address);
}
void show();
void buy()
{
cout<<"House is Purchased"<<endl;
}
void sale()
{
cout<<"House is for Sale"<<endl;
}
void rent()
{
cout<<"House is for Rent\n"<<endl;
}
~house() //destructor
{
cout<<"\tHouse
Closed"<<endl;
}
};
void house::show()
{
cout<<"\nHouse Name = "<<name<<endl;
cout<<"Area "<<area<<"
Marla"<<endl;
cout<<"Owner Name ="<<owner<<endl;
cout<<"Its Address
="<<address<<endl<<endl;
}
int main()
{
house s;
s.show();
s.buy();
s.sale();
s.rent();
getch();
}
No comments:
Post a Comment