学生成绩管理系统(c语言)课程设计报告
学生成绩管理系统(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字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [稿件大全]不忘初心牢记使命 党课演讲稿,忠诚干
- [稿件大全]节能环保演讲稿:给生命关怀
- [稿件大全]《麦田里的守望者》读书报告演讲稿
- [稿件大全]“五四”青年节演讲稿_弘扬“五四精神
- [稿件大全]建国70周年演讲稿:践行新使命 续航新
- [稿件大全]五四演讲稿:弘扬“五四精神”做一名逐
- [稿件大全]建国70周年演讲稿:我和我的祖国
- [稿件大全]高三演讲稿_用梦想点燃青春
- [稿件大全]关于禁毒演讲稿:“健康人生,绿色无毒
- [稿件大全]五四精神演讲稿:继续前行
- [稿件大全]党课演讲稿:以更好的精神状态肩负起新
- [稿件大全]护士演讲稿_做有温度的人,做有意义的
- [稿件大全]书记抓基层党建述职评议大会讲话稿
- [稿件大全]高三成人礼演讲稿:遇见最美的你
- [稿件大全]“五四”青年节演讲稿_传承五四精神 放
- [稿件大全]五四运动一百周年演讲稿:什么是“五四
- [稿件大全]纪念五四运动100周年演讲稿三篇
- [稿件大全]岗位竞选演讲稿
- [稿件大全]演讲稿:敢于担当 为命运掌舵
- [稿件大全]争先创优演讲稿:五心服务铸就五星梦想
- 毕业感言:六年相伴(合集16篇)(毕业
- 毕业三十年的聚会感言(共18篇)(毕业
- 转职能转方式转作风发言稿(精选9篇)(
- 教师比赛开场白(通用16篇)(教师比赛
- 婚礼上新人家长致辞(锦集15篇)(婚礼
- 秘书专业实习的自我总结(合集20篇)
- 高速公路票证员个人工作总结(锦集14篇
- 会计毕业实习报告总结及体会(通用12篇
- 收费站监控员年度个人总结(精选15篇)
- 秋季初中新学期开学第一周国旗下讲话稿
- 支部讨论会主持词(精选16篇)(支部讨
- 小朋友主持词开场白(通用19篇)(小朋
- 小班下学期保育员个人工作总结(精选12
- 工会主席在工会工作会议上的讲话(整理
- 幼儿园衔接班家长会发言稿(锦集18篇)
- 剪刀手爱德华台词(整理6篇)(剪刀手爱
- 国旗下的新年寄语讲话演讲稿(精选18篇
- 物业公司物管员个人总结(共16篇)(物
- 学校晚会主持串词(精选10篇)(学校晚
- 婚礼新人入场主持词(通用15篇)(婚礼




