编程:计算该学生应付的学费

来源:百度知道 编辑:UC知道 时间:2024/06/17 13:49:45
要求:大学里对不同性质的学生听课收费不同。某校是这样规定的:本校全日制学生不收费;本校夜大学生选课12学分及以下付200元,然后每增加一个学分付20元;对外校学生选课12学分及以下付600元,然后每增加一个学分付60元。输入某个学生的编号、选课学分以及学生类型,编程计算该学生应付的学费。
求高手写出程序,追加分数!
最好由程序流程图,越快越好
c语言
312561541
+我啊 ,帮我调一下,必有重谢!

要什么语言的?
void main()
{int stu_no;
int score;
int stu_type;
int xuefei;
printf("Input a student's message:\n");
scanf("stu_no=%d,score=%d,stu_type=%d",&stu_no,&score,&stu_type);
if(stu_type==1) //为在校生?
{xuefei=0;
printf("The student have to hand in xuefei %d",xuefei);
}
else
if(stu_type==2) //为夜大生?
{if(score<12)
xuefei=200;
else
xuefei=200+20*(score-12);
printf("The student have to hand in xuefei %d",xuefei);
}
else
if(stu_type==3) //为外校学生?
{if(score<12)
xuefei=600;
else
{xuefei=600+60*(score-12);
printf("The student have to hand in xuefei %d",xuefei);
} }
else
printf("Wrong input!");
}

好久没碰C了~机子上也没装C,很不负责任的给你编了这个程序,你自己去调一下,应该不会有什么大问题~只是不知道算法等符不符合你的要求.

我C++调了一下,小错是没有了`如果你没有什么其它特别的算法要求的话, 这个程序应该可以了.