学生成绩管理系统课程设计报告Word格式文档下载.docx

上传人:b****5 文档编号:19530035 上传时间:2023-01-07 格式:DOCX 页数:9 大小:45.81KB
下载 相关 举报
学生成绩管理系统课程设计报告Word格式文档下载.docx_第1页
第1页 / 共9页
学生成绩管理系统课程设计报告Word格式文档下载.docx_第2页
第2页 / 共9页
学生成绩管理系统课程设计报告Word格式文档下载.docx_第3页
第3页 / 共9页
学生成绩管理系统课程设计报告Word格式文档下载.docx_第4页
第4页 / 共9页
学生成绩管理系统课程设计报告Word格式文档下载.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

学生成绩管理系统课程设计报告Word格式文档下载.docx

《学生成绩管理系统课程设计报告Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《学生成绩管理系统课程设计报告Word格式文档下载.docx(9页珍藏版)》请在冰豆网上搜索。

学生成绩管理系统课程设计报告Word格式文档下载.docx

public:

intClass,num;

charname[8];

floatcpp,math,eng,ave;

intorder;

Student*next;

Student(){}

Student(intc1,intn1,char*n,floate1,floatc2,floatm,floate2,floats,floatp,floata,

into,Student*next=NULL)

{

Class=c1;

num=n1;

strcpy(name,n);

cpp=c2;

math=m;

eng=e2;

ave=a;

order=o;

this->

next=next;

}

主要功能函数的设计:

1.创建学生数据,对学生的成绩的录入。

代码:

friendStudent*Create(Student*head,istream&

in)

{inty;

Student*p;

intClass,num;

charname[8];

floatcpp,math,eng;

if(&

in==&

cin)

函数为删除函数的实现部分。

主要代码:

friendStudent*DeleteStudent(Student*head,intnum)

Student*p1=head,*p2=p1;

while(p2&

&

p2->

num!

=num)

p1=p2,p2=p2->

next;

if(p2)

{

if(p2==p1)

{

head=head->

deletep1;

}

else

p1->

next=p2->

deletep2;

cout<

<

"

已删除"

num<

号学生数据\n"

;

SetOrder(head);

}elsecout<

没找到指定学生!

\n"

returnhead;

4.排序函数中平均分来排序,排序结果为降序操作。

friendvoidSetOrder(Student*head)

{

intorder=1;

while(head)

{head->

order=order++;

head=head->

}

5.修改学生的信息

friendStudent*Modify(Student*head,intnum)示数据:

friendvoidOutputAll(constStudent*head)均数据函数

friendvoidStatistic(constStudent*head)

inti=0;

float

ave_cpp=0,

ave_math=0,

ave_eng=0;

ave_cpp+=head->

cpp;

ave_math+=head->

math;

ave_eng+=head->

eng;

i++;

}

if(!

i)

\n\n没有任何学生数据!

return;

cout<

\n\n\t\t各门课程平均成绩表\n\n"

tC++\t数学\t英语\n"

ave_cpp/i<

'

\t'

ave_math/i<

<

ave_eng/i<

endl;

程序测试结果:

1运行程序.会出现如下画面,按照提示进行选择.

2.首先选择1,然后按Enter键.按照提示对学生情况进行输入.如图:

3.按1键可以添加多个学生成绩的数据,按2返回主界面。

4.选择5,然后按Enter键,显示刚才输入的数据和排名的情况。

5在主界面选择2可以修改学生的数据。

6.在主界面选择3可以按学号查询学生成绩情况

7.在主界面选择7可以按学号删除学生的成绩信息

三、设计总结

这次课程设计基本上涵盖了学习到的C++语言知识点,课程设计题目要求不仅要求对课本虽然是网上搜来的代码,但这些代码没办法运行,我把这些代码改了和增加了自己写的代码,终于可以运行,而且到达自己想要的结果,这次课程设计不仅让我修补了以前学习的漏洞,也让我知道一个道理:

编程需要兴趣和实际动手。

C++语言程序设计课程设计,我从中受益匪浅,并且对C++语言程序设计这一门课程有了更深一步的认识。

附件

程序源代码清单:

#include<

>

friendintValid(floatscore)

return(score<

0||score>

100)0:

1;

friendStudent*Insert(Student*head,Student*p)键盘录入与添加数据*\n"

文件录入与添加数据*\n"

\t\t*2.修改数据*\n"

\t\t*3.查询数据*\n"

\t\t*4.删除数据*\n"

\t\t*5.显示数据*\n"

\t\t*6.平均数据*\n"

存数据*\n"

\t\t**\n"

\t\t*0.退出系统*\n"

\t\t**********************************\n\n"

};

voidmain(void)

{

Student*head=0;

intselect;

while

(1)

ShowMenu();

\t\t请输入你的选择(0~6):

cin>

select;

switch(select)

case0:

DeleteChain(head);

\n\n谢谢您使用本系统!

\n\n"

return;

case1:

head=Create(head,cin);

break;

/*case2:

charfname[256];

cout<

请输入文件名:

();

(fname,256);

ifstreamin(fname);

if(!

in)

{

cout<

\n不能打开"

fname<

文件!

break;

}

head=Create(head,in);

break;

}*/

case2:

intnum;

请输入学号:

cin>

num;

head=Modify(head,num);

case3:

constStudent*t=Lookup(head,num);

if(t)

\t\t\t\t"

t->

name<

同学的成绩表\n"

班级\t姓名\t学号\tC++\t数学\t英语\t名次\n"

OutputOne(t);

}elsecout<

没有找到指定学生!

case4:

head=DeleteStudent(head,num);

}break;

case5:

OutputAll(head);

case6:

Statistic(head);

/*case7:

if(head)

SaveAll(head,fname);

}elsecout<

\n\n尚无数据可保存!

*/

default:

\n\n非法操作!

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

当前位置:首页 > 医药卫生

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

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