题目是。税收的计算方法是。5000元以下不收税,5001-15000收10%,15001-35000收15%,35000以上收20%。
有人收入38000那么所得税是5000*0。00+10000*0。10+20000*0。15+3000*0。20。我的程序如下,但怎么运行不起来啊,错在哪?
#include<iostream.h>
#include<conio.h>
const double lev1=5000;
const double lev2=15000;
const double lev3=35000;
const double rat1=0.1;
const double rat2=0.15;
const double rat3=0.2;
void main()
{double income;
double tax;
cout<<"Enter your income:"<<endl;
double income;
double tax;
cin>>income;
if{income<=lev1;
tax=0;}
esle if{income<=lev2;
cout<<tax=(income-lev1)*rat1<<endl;}
else if{income<=Lev3;
tax=rat1*(lev2 -lev1)+rat2*(income -lev2); }
else
{tax=rat1*(lev2 -lev1)+rat2*(lev3 -lev2)
+rat3*(income -lev3);}
}
cout<<"You owe Neutronia"<<tax<<"tvarpsintaxes."
_getch();
}