C语言学生管理系统综合实验报告Word文档格式.docx

上传人:b****2 文档编号:15175806 上传时间:2022-10-28 格式:DOCX 页数:22 大小:516.48KB
下载 相关 举报
C语言学生管理系统综合实验报告Word文档格式.docx_第1页
第1页 / 共22页
C语言学生管理系统综合实验报告Word文档格式.docx_第2页
第2页 / 共22页
C语言学生管理系统综合实验报告Word文档格式.docx_第3页
第3页 / 共22页
C语言学生管理系统综合实验报告Word文档格式.docx_第4页
第4页 / 共22页
C语言学生管理系统综合实验报告Word文档格式.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

C语言学生管理系统综合实验报告Word文档格式.docx

《C语言学生管理系统综合实验报告Word文档格式.docx》由会员分享,可在线阅读,更多相关《C语言学生管理系统综合实验报告Word文档格式.docx(22页珍藏版)》请在冰豆网上搜索。

C语言学生管理系统综合实验报告Word文档格式.docx

c)统计:

可以选择统计各学生的平均成绩或统计所有存在不及格科目的学生;

5.数据输出:

输出学生的相应结果信息;

6.退出:

退出整个学生信息管理系统。

7.输出结果截屏的第一条记录一定要反映出你自己的真实信息。

三、程序组织结构图、函数调用关系图

四、程序清单

#include<

stdio.h〉

#include<

iostream。

h〉

#include〈string。

h>

structstudent

charnum[10];

charname[10];

charsex[4];

charclas[20];

intyw,sx,yy;

floatave;

}stu[100];

inti,j;

voidInputData()

{

charx;

while

(1)

printf(”\t学号:

”);

scanf(”%s"

,stu[i]。

num);

printf(”\t姓名:

”);

scanf(”%s"

stu[i].name);

printf("

\t性别:

"

);

scanf("

%s”,stu[i]。

sex);

\t班级:

scanf(”%s"

stu[i].clas);

\t语文:

scanf(”%d"

,&stu[i]。

yw);

\t数学:

%d"

,&

stu[i]。

sx);

printf(”\t英语:

scanf(”%d”,&stu[i].yy);

stu[i]。

ave=float((stu[i].yw+stu[i]。

sx+stu[i].yy)/3。

0);

i++;

printf(”\t是否继续输入数据(Y。

N)"

cin>

〉x;

if(x==’n'

||x==’N’)break;

}

voidEditData()

intcount=0;

charstr[10];

printf(”\n请输入学生学号:

〉str;

while(count〈i)

if(strcmp(str,stu[count].num)==0)

printf("

学号姓名性别班级语文数学英语\n”);

-——--—----—---—-—————--—-———--——--———--———-------—-——-——-———--——\n"

%-11s"

stu[count]。

num);

printf(”%—13s”,stu[count]。

name);

printf(”%—8s"

,stu[count].sex);

printf(”%-16s"

,stu[count]。

clas);

%-6d"

,stu[count].yw);

printf(”%—6d”,stu[count]。

%—4d”,stu[count].yy);

printf(”\n”);

printf(”-—-——————-—--——-—-—--—----————--—---——-———---——----——————--—-———\n"

break;

count++;

if(count>

=i)

printf(”\n查无此人”);

else

\n\t修改数据:

\n”);

\t学号:

stu[i]。

\t姓名:

scanf(”%s”,stu[i]。

%s"

,stu[i].clas);

printf(”\t语文:

);

%d”,&stu[i].yw);

\t数学:

stu[i]。

sx);

%d”,&

stu[i]。

yy);

stu[count]。

ave=float((stu[count]。

yw+stu[count].sx+stu[count].yy)/3。

0);

voidsx()

structstudenttemp;

inta,b,c;

for(a=0;

a<

i—1;

a++)

c=a;

for(b=a+1;

b〈i;

b++)

if(stu[b]。

ave>

stu[c]。

ave)

c=b;

temp=stu[b];

stu[b]=stu[c];

stu[c]=temp;

排序后结果为:

printf(”学号姓名性别班级语文数学英语\n"

printf(”——-—-—-—---———-————-————---—--——--——----———--———-—--—---——-—-——-\n”);

for(c=0;

c〈i;

c++)

printf(”%—11s”,stu[c].num);

printf(”%-13s”,stu[c]。

name);

%-8s"

,stu[c].sex);

%—16s"

,stu[c]。

printf(”%-6d”,stu[c]。

%—6d"

,stu[c].sx);

%-4d”,stu[c].yy);

\n"

-——-—--——--—----—-—-—-——-———--—-—-——---————--———--———-—-—--—-—--\n”);

voidcx()

intcount=0;

charstr[10];

\n请输入要查询的学生学号:

cin〉〉str;

while(count<

i)

if(strcmp(str,stu[count].num)==0)

—----—-—-——-—-——-—---—--—-----—--——--—-—-——-———-———----——----—--\n”);

printf(”%-11s"

stu[count]。

printf(”%-13s”,stu[count].name);

%—8s"

,stu[count]。

sex);

%—16s"

,stu[count].clas);

%-6d”,stu[count].yw);

%-6d”,stu[count]。

printf(”%—4d"

printf(”\n”);

printf(”——-——-——-----—-———————--————---—-——--—---——---—-——--—-—--——--———\n”);

if(count〉=i)

printf(”\n无该学号学生”);

voidtjpjf()

intcount=0;

stu[i]。

ave=float((stu[i].yw+stu[i]。

sx+stu[i]。

yy)/3。

学号姓名平均分\n”);

—----—-—--—--—--—-----——---——----——-——--—----—-—--\n"

for(j=0;

j<

i;

j++)

while(count<

for(j=0;

i;

%—21s”,stu[count].num);

printf(”%-21s"

stu[count]。

%—6.2f"

stu[count].ave);

printf(”\n"

——--—--——--—-—--—-—----——-———---—-—-———-——-----—--\n"

voidtjbhgrs()

intj,count=0;

有不及格科目的学生是:

\n”);

printf(”学号姓名性别班级语文数学英语\n”);

——--——---———-——---———-----—-—--——--------—--—--—--—-————-——-————\n"

for(j=0;

if(stu[j].yw<

60||stu[j].sx<

60||stu[j]。

yy〈60)

{printf("

%-11s"

,stu[count].num);

printf(”%-13s”,stu[count]。

printf(”%—8s”,stu[count].sex);

printf(”%—16s”,stu[count]。

clas);

printf(”%-6d”,stu[count].yw);

printf(”%-6d”,stu[count].sx);

printf(”%—4d"

,stu[count].yy);

printf(”\n"

printf(”——-—-————-----—————---——---————————-——--—--—-—-—-——-—-—————-----\n”);

voidtj()

charx;

\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n”);

printf(”\t1.统计平均分2。

统计不及格学生信息3。

返回\n”);

\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n”);

\n\t请选择具体的统计内容:

switch(x)

case'

1'

:

tjpjf();

break;

2'

tjbhgrs();

bre

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 党团建设

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1