100分求助,写一个关于税的程序(限时4点前完成!)
朋友要写一个关于税的程序,><~~~,C这个东东忘掉好久了,所以想请高手帮忙!(限时3月3日4点前完成!)
1。能够收税的收入(income)等于总收入减去扣除标准的免除项(每一项一千),最多12项。
能够收税的收入不能够小于零。
2.税率根据下表来决定:
Filing status Taxable income Tax rate
Single less than $5,000 15%
$5,000 - $20,000 22%
more than $20,000 31%
Married less than $10,000 15%
$10,000 - $40,000 22%
more than $40,000 31%
Married filing jointly less than $7,000 17%
$7,000 - $25,000 24%
more than $25,000 33%
然后有六个注意事项:
1。所有需要输入字母的,如状态(单身、结婚等),必须是大写字母
2。状态必须是S代表单身,M代表结婚了,J代表夫妻一同报税。如果不是这三个,显示错误信息
3。决定税率的方面必须要用嵌套,不能连用9个IF
4。所收的税不能是负数……
5。免税项必须是0-12之间的任何一个数字,如果不是显示错误
6。如果一个人没收入,只有损失,(也就是说这个是负数),则不计算税率
已经做出来的某些部分是:
#include <stdio.h)
int main(void)
{
char status;
int exemption;
double ID, /* Taxpayer ID */
income,
rate; /*the tax rate */
switch (status)
{
case S: {
if (income < 5000),
then rate = 0.15;
if (5000 <= income <=20000),
then rate = 0.22;
if (income >20000),
then rate = 0.31;
end if
}
case M: {
if (income < 10000),
then rate = 0.15;
if (10000 <= income <= 40000),
then rate = 0.22;
if (income >40000),
then rate = 0.31;
end if
}
case J: {
if (income < 7000),
then rate = 0.17;
if (7000 <= income <=25000),
then rate = 0.24;
if (income > 25000),
then rate = 0.33;
end if
}
问题点数:100、回复次数:3Top




