C语言学生管理系统综合实验报告.docx

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

C语言学生管理系统综合实验报告.docx

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

C语言学生管理系统综合实验报告.docx

C语言学生管理系统综合实验报告

佛山科学技术学院

实验报告

实验名称小型学生信息管理系统

实验项目编写一学生信息管理系统,用来管理学生基本信息及成绩信息

专业班级姓名XXX学号

指导教师成绩日期

一、试验目的

本实验为学生提供了一个既动手又动脑,上机实践的机会。

学生通过分析和解决该实验,将课本上的理论知识和实际有机地结合起来,锻炼学生分析、解决较复杂问题的能力,提高学生编写综合系统程序的能力。

二、实验内容

编写一个学生信息管理系统,主要用来管理学生基本信息及成绩信息。

系统功能模块如下图:

具体要求为:

1.建立学生信息,每个学生的信息应包括:

学号、姓名、性别、班级、至少3门课程的成绩;

2.数据输入:

输入学生的各项信息;

3.数据修改:

根据输入学生的学号可以选择修改该学生的信息;

4.数据处理:

可以选择处理方式为:

排序、查询、统计。

其中:

a)排序:

按学号排序

b)查询:

根据学号查询成绩

c)统计:

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

5.数据输出:

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

6.退出:

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

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

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

四、程序清单

#include

#include

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);

printf("\t班级:

”);

scanf(”%s",stu[i].clas);

printf("\t语文:

”);

scanf(”%d",&stu[i]。

yw);

printf("\t数学:

”);

scanf("%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请输入学生学号:

");

cin>〉str;

while(count〈i)

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

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

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

printf("%-11s",stu[count]。

num);

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

name);

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");

break;

count++;

}

if(count>=i)

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

else

printf("\n\t修改数据:

\n”);

printf("\t学号:

”);

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

num);

printf("\t姓名:

”);

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

name);

printf("\t性别:

");

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

sex);

printf("\t班级:

”);

scanf("%s",stu[i].clas);

printf(”\t语文:

");

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

printf("\t数学:

”);

scanf(”%d",&stu[i]。

sx);

printf(”\t英语:

");

scanf("%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

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");

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

for(c=0;c〈i;c++)

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

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

name);

printf("%-8s",stu[c].sex);

printf("%—16s",stu[c]。

clas);

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

yw);

printf("%—6d",stu[c].sx);

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

printf("\n");

}

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

}

voidcx()

{

intcount=0;

charstr[10];

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

”);

cin〉〉str;

while(count

{

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

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

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

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

num);

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

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”);

break;

count++;

if(count〉=i)

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

else

printf("\n");

}

}

voidtjpjf()

intcount=0;

stu[i]。

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

sx+stu[i]。

yy)/3。

0);

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

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

for(j=0;j

while(count

{

for(j=0;j

{

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

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

name);

printf("%—6.2f",stu[count].ave);

count++;

printf(”\n");}

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

voidtjbhgrs()

{

intj,count=0;

printf("有不及格科目的学生是:

\n”);

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

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

for(j=0;j

if(stu[j].yw<60||stu[j].sx<60||stu[j]。

yy〈60)

{printf("%-11s",stu[count].num);

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

name);

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");

}

count++;

}

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

voidtj()

{

charx;

while

(1)

{

printf("\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n”);

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

统计不及格学生信息3。

返回\n”);

printf("\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n”);

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

");

cin>〉x;

printf("\n");

switch(x)

case'1':

tjpjf();break;

case'2':

tjbhgrs();bre

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

当前位置:首页 > 人文社科 > 法律资料

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

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