Uploaded by MUHAMMAD OSAMA

Lab project oop

advertisement
Lab project:
#include <iostream>
using namespace std;
int count;
int p;
int check,pas;
int enter,password=342931;
char ch,con,choice;
class information
{
public:
void houses()
{
cout<<"House 1:"<<endl;
cout<<"In islamabad :"<<endl;
cout<<"in corner:"<<endl;
cout<<"area is 1200 to 1800 meter squre:"<<endl;
cout<<"price range 10,000 t 25,000:"<<endl;
cout<<"House 2 :"<<endl;
cout<<"In islamabad :"<<endl;
cout<<"in middle:"<<endl;
cout<<"area is 1800 to 2200 meter squre:"<<endl;
cout<<"price range 25,000 t 30,000:"<<endl;
cout<<"House 3 :"<<endl;
cout<<"In peshawer :"<<endl;
cout<<"in middle:"<<endl;
cout<<"area is 1400 to 2000 meter squre:"<<endl;
cout<<"price range 8,000 t 15,000:"<<endl;
cout<<"House 4 :"<<endl;
cout<<"In Abbottabad :"<<endl;
cout<<"in corner:"<<endl;
cout<<"area is 1000 to 1600 meter squre:"<<endl;
cout<<"price range 7,000 t 12,000:"<<endl;
press();
}
void particular()
{ cout<<"House 1:"<<endl;
cout<<"In islamabad :"<<endl;
cout<<"price range 10,000 t 25,000:"<<endl;
cout<<"House 2 :"<<endl;
cout<<"In islamabad :"<<endl;
cout<<"price range 25,000 t 30,000:"<<endl;
cout<<"House 3 :"<<endl;
cout<<"In peshawer :"<<endl;
cout<<"price range 8,000 t 15,000:"<<endl;
cout<<"House 4 :"<<endl;
cout<<"In Abbottabad :"<<endl;
cout<<"price range 7,000 t 12,000:"<<endl;
press();
}
void press()
{
int p,c;
cout<<"Enter information of house "<<endl;
cout<<"Select city 1:islamabad 2:peshawer 3:abbottabad"<<endl;
cin>>c;
cout<<"enter price range you want"<<endl;
cin>>p;
cout<<"***Serching***"<<endl;
if(c==1&&p>1000&&p<25000)
{ cout<<"House 1:"<<endl;
cout<<"In islamabad :"<<endl;
cout<<"price range 10,000 t 25,000:"<<endl;
deal();
}
else if(c==1&&p>25000&&p<30000)
{cout<<"House 2 :"<<endl;
cout<<"In islamabad :"<<endl;
cout<<"price range 25,000 t 30,000:"<<endl;
deal();
}
else if(c==2&&p>8000&&p<15000)
{cout<<"House 3 :"<<endl;
cout<<"In peshawer :"<<endl;
cout<<"price range 8,000 t 15,000:"<<endl;
deal();
}
else if(c==3&&p>7000&&p<12000)
{
cout<<"House 4 :"<<endl;
cout<<"In Abbottabad :"<<endl;
cout<<"price range 7,000 t 12,000:"<<endl;
deal();
}
else
{
cout<<"we cannot find house of your information"<<endl<<endl;
particular();
}
}
void deal()
{
do{
cout<<"Do you want to done the deal"<<endl;
cin>>choice;
}while(choice!='y'&&choice!='n');
if(choice=='y'||choice=='Y')
{
do{
cout<<"Enter password to confrm"<<endl;
cin>>pas;
}while(pas!=password);
cout<<"****congrate deal is done ****** ";
}
else
do{
cout<<"are you sure to cancel deal"<<endl;
cin>>choice;
}while(choice!='y'&&choice!='n');
if(choice=='y'||choice=='Y')
{cout<<"THANK YOU come again"<<endl;
}
else
press();
}
};
class display:public information
{
public:
void disp()
{
int inf;
cout<<"Do you want to see"<<endl;
cout<<"1: All information "<<endl;
cout<<"2: particular"<<endl;
cin>>inf;
if(inf==1)
information::houses();
else
information::particular();
}
};
class property:public display
{
public:
int a,p;
int c;
int l;
public:
void menu()
{
cout<<"
do
WELCOME to our website
"<<endl;
{
cout<<"*****MENUE******"<<endl;
cout<<"1: DO you want to sell a house"<<endl;
cout<<"2: BYE a hous "<<endl;
cout<<"3: take on rent"<<endl;
cout<<"4: Give on rent"<<endl;
cout<<"5: Exit"<<endl;
cin>>enter;
if (enter==1|| enter==3)
addinform ();
if (enter==2|| enter==4)
display::disp ();
}
while(enter!=1&&enter!=2&&enter!=3&&enter!=4&&enter!=5);
if(enter==5)
{
do{
cout<<"Arke you sure to Exit"<<endl;
cin>>choice;
}while(choice!='y'&&choice!='n');
if(choice=='y'||choice=='Y')
cout<<"Thank you for joining us: come again"<<endl;
else
menu();
}
}
int addinform()
{
do{cout<<"please enter area"<<endl;
cin>>a;
}while(a>2400||a<1200);
do
{cout<<"enter city"<<endl;
cout<<" 1: abbottabad 2: peshawer 3: islamabad"<<endl;
cin>>c;
}
while(c!=1&&c!=2&&c!=3);
do{
cout<<"enter Location 1:middle/2:corner"<<endl;
cin>>l;
}while(l!=1&&l!=2);
do{
cout<<" Price range "<<endl;
cin>>p;
}while(p<1000);
inf_house();
do{
cout<<"Are you sure to sell the house ?"<<endl;
cin>>choice;
}
while(choice!='y'&&choice!='n');
if(choice=='y'||choice=='Y')
{
do{
cout<<"Please enter Password"<<endl;
cin>>pas;
}
while(pas!=password);
cout<<"Congrate your property has been sold"<<endl;
do
{
cout<<"Do you want to do another deal"<<endl;
cin>>con;
}while(con!='y'&&con!='n');
if(con=='y'||con=='Y')
{cout<<"*********************";
menu();
}
else
cout<<"Thank you come again";
}
else if(choice=='n'||choice=='N')
{cout<<"Are you sure to close it";
cin>>ch;
if(ch=='y')
cout<<"Thank you for joining us";
else
addinform();
}
}
void inf_house()
{
cout<<"Information of house"<<endl;
cout<<"area is : "<<a<<endl;
cout<<"city is : ";
if(c==1)
cout<<"Abbottabad"<<endl;
else if(c==2)
cout<<"Peshawer "<<endl;
else if(c==3)
cout<<"Islamabad"<<endl;
cout<<"location is : ";
if(l==1)
cout<<"middle"<<endl;
else
cout<<"corner"<<endl;
cout<<"price is : "<<p<<endl;
}
};
int main()
{
property proj;
proj.menu();
information h;
}
Download