#include<iostream.h>
#include<conio.h>
class person
{
char name[20];
char addr[30];
float sal;
int pro;
float tax_amt;
public:
void accept()
{
cout<<"\n\nEnter person name : ";
cin>>name;
cout<<"\n\nEnter person address : ";
cin>>addr;
cout<<"\n\nEnter person salary : ";
cin>>sal;
cout<<"\n\nEnter Property in sq. foot area : ";
cin>>pro;
tax_amt=0.00;
}
void cal_tax()
{
if(sal<5000.00)
tax_amt=0.00;
else if(sal>=5000.00 && sal<=10000.00)
tax_amt=(sal*0.14);
else
tax_amt=(sal*0.16);
}
void add_ext()
{
if(pro<1000)
tax_amt=tax_amt+0;
else if(pro>=1000 && pro<=5000)
tax_amt=tax_amt+1000;
else
tax_amt=tax_amt+3000;
}
void disp()
{
cout<<"\n\nTax Amount is : "<<tax_amt;
}
};



int main()
{
clrscr();
person a;
a.accept();
a.cal_tax();
a.add_ext();
a.disp();
getch();
return 0;
}

Post a Comment

Previous Post Next Post