#include<iostream.h>
#include<conio.h>
class Saltax
{
float x,t;
public:
Saltax()
{
t=x=0;
}
void get();
void perform();
};
void Saltax::get()
{
cout<<"Enter the salary:";
cin>>x;
return x;
}
void Saltax::perform()
{
if(x<=1000)
t=0;
else if(x>1000&&x<=2000)
{
t=x*5/100;
}
else if(x>2000&&x<=3000)
{
t=(x*4/100);
}
else
t=(x*3/100);
return t;
}
void main()
{
clrscr();
Saltax s;
cout<<"Your salary is\t:"<<s.get()<<endl;
cout<<"The tax apply on your salary is\t:"<<s.perform()<<endl;
getch();
}
Mian_7 0 Newbie Poster
John_165 44 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.