教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 范文大全 > 稿件大全 >

学生成绩管理系统(c语言)课程设计报告

来源:网络收集 时间:2026-08-27
导读: 学生成绩管理系统(c语言)课程设计报告 http://www.77cn.com.cn/cyuyan/10.html 学生成绩管理系统(c语言)课程设计报告 学生成绩管理系统 要求是这样的 1、用c语言编写一个简单的学生信息管理程序,能实现对学生信息的简单管理。 2、具体要求: 建立一个4个学

学生成绩管理系统(c语言)课程设计报告

http://www.77cn.com.cn/cyuyan/10.html

学生成绩管理系统(c语言)课程设计报告

学生成绩管理系统

要求是这样的

1、用c语言编写一个简单的学生信息管理程序,能实现对学生信息的简单管理。

2、具体要求:

建立一个4个学生的信息登记表,每个学生的信息包括:学号,姓名,和3门课程的成绩(FOX,C,ENGLISH)。 程序运行时显示一个简单的菜单,例如:

(1):信息输入(INPUT)

(2):总分统计(COUNT)

(3):总分排序(SORT)

(4):查询(QUERY)

其中:

(1):对4个学生的信息进行输入;

(2):对每个学生的3门课程统计总分;

(3):对4个学生的总分按降序排序并显示出来;

(4):查询输入一个学号后,显示出该学生的有关信息;

............

偶先写了个...

#i nclude<iostream.h>

#i nclude<stdlib.h>

struct student

{

int num;

char name[20];

int foxscore;

int cscore;

int englishscore;

struct student *next;

};

void menu()

{

cout<<" welecome to my student grade management system"<<endl;

cout<<" please follow everyone step in the menu"<<endl;

cout<<" 1.input information"<<endl;

cout<<" 2.total scores"<<endl;

cout<<" 3.sort"<<endl;

cout<<" 4.query"<<endl;

cout<<" ***************************************************"<<endl;

}

学生成绩管理系统(c语言)课程设计报告

struct student *creat(struct student *head) // 函数返回的是与节点相同类型的指针

{

struct student *p1,*p2;

p1=p2=(struct student*) malloc(sizeof(struct student)); // 申请新节点

cin>>p1->num>>p1->name>>p1->foxscore>>p1->cscore>>p1->englishscore; // 输入节点的值 p1-> next = NULL; // 将新节点的指针置为空

while(p1->num>0)

{

if (head==NULL) head=p1; //空表,接入表头

else p2->next=p1; // 非空表,接到表尾

p2 = p1;

p1=(struct student *)malloc(sizeof(struct student)); //申请下一个新节点

cin>>p1->num>>p1->name>>p1->foxscore>>p1->cscore>>p1->englishscore;

//输入节点的值

}

return head; //返回链表的头指针

}

void count(struct student *head)

{

struct student *temp;

temp=head; //取得链表的头指针

while(temp!==NULL)

{

int m;

m=temp->foxscore+temp->cscore+temp->englishscore;

cout<<m<<endl;//输出链表节点的值

temp=temp->next; //跟踪链表增长

}

}

void sort(struct student *head)

{

struct student *tp;

tp=head;

int a[4];//定义总分数组

int i,j,k;

while(temp!==NULL)

{

a[i]=tp->foxscore+tp->cscore+tp->englishscore;

tp=tp->next;

i=i+1;

}

学生成绩管理系统(c语言)课程设计报告

for(j=1;j<=3;j++)//冒泡法排序

for(k=1;k<=4-j;k++)

if(a[k]<a[k+1])

{

int t=a[k];a[k]=a[k+1];a[k+1]=t;

}

for(i=1;i<5;i++)

cout<<a[i]<<endl;

}

void query(struct student *head)

{

struct student *temper;

temper=head;

int number;

cin>>number;

for(int i=1;i<=4;i++)

{

if(number==temper->num)

{

cout<<" name is:"<<temper->name<<endl;

cout<<" fox score is:"<<temper->foxscore<<endl;

cout<<" c score is:"<<temper->cscore<<endl;

cout<<" English score is:"<<temper->englishscore<<endl;

cout<<" congratulation,syetem have found what you want to search"<<endl;

}

temper=temper->next;

}

}

void main()

{

menu();

cout<<" firstly,please input information:"<<endl;

struct student *head;

head=NULL; /* 建一个空表*/

head=creat(head); /* 创建单链表*/

cout<<" secondly,count the total score each student:"<<endl;

count(head);

cout<<" thirdly,sorting the total score:"<<endl;

sort(head);

cout<<" enter num that you can search each shtudent's information"<<endl;

query(head);

cout<<" thanks you for use my student grade management system"<<endl;

}

学生成绩管理系统(c语言)课程设计报告

编译时候都没有错....

debug输入时候出现了错误....

调试运行后发现原来是while循环出了问题啊

修改后.........

#i nclude<iostream.h>

#i nclude<stdlib.h>

struct student

{

int num;

char name[20];

int foxscore;

int cscore;

int englishscore;

struct student *next;

};

void menu()

{

cout<<" welecome to my student grade management system"<<endl;

cout<<" please follow everyone step in the menu"<<endl;

cout<<" 1.input information"<<endl;

cout<<" 2.total scores"<<endl;

cout<<" 3.sort"<<endl;

cout<<" 4.query"<<endl;

cout<<" ***************************************************"<<endl;

}

struct student *creat(struct student *head) // 函数返回的是与节点相同类型的指针

{

struct student *p1,*p2;

p1=p2=(struct student*) malloc(sizeof(struct student)); // 申请新节点

cin>>p1->num>>p1->name>>p1->foxscore>>p1->cscore>>p1->englishscore; / …… 此处隐藏:10385字,全部文档内容请下载后查看。喜欢就下载吧 ……

学生成绩管理系统(c语言)课程设计报告.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/fanwen/754678.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)