学分绩点计算C源代码学分绩点计算C源代码
#include
#include
int main()
{
float score 0.0;
float grade_point = 0.0;
float avg1 = 0.0;
float avg2 = 0.0;
float GPA = 0.0;
int count = 0;
while(score>0)
{
printf("请输入课程学分数:");
scanf("%f", &grade_point);
printf("请输入课程成绩:");
scanf...
学分绩点计算C源代码
#include
#include
int main()
{
float score 0.0;
float grade_point = 0.0;
float avg1 = 0.0;
float avg2 = 0.0;
float GPA = 0.0;
int count = 0;
while(score>0)
{
printf("请输入课程学分数:");
scanf("%f", &grade_point);
printf("请输入课程成绩:");
scanf("%f", &score);
if(score<60) score=0.0;
if(score<=69&&score>=60) score=1.0+score-60;
if(score<=79&&score>=70) score=1.0+score-70;
if(score<=89&&score>=80) score=1.0+score-80;
if(score<=100&&score>=90) score=1.0+score-90;
avg1 = avg1 + (grade_point*score);
avg2 = avg2 + grade_point;
}
GPA = avg1/avg2;
printf("该门课程的GPA=%f\n", GPA);
return 0;
}
本文档为【学分绩点计算C源代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。