跪求C语言大作业学生管理系统的程序

来源:百度知道 编辑:UC知道 时间:2024/06/15 14:51:03
C语言程序设计大作业
1题目:学生信息管理系统
2 程序要求:
(1)学生信息录入功能
1)用户从键盘输入每个学生的信息:学号、姓名、性别、数学、英语、政治、语文四门课成绩。
2)可插入一个或多个学生信息到当前编辑的班级数据中。
(2)文件保存功能
1)学生信息每一班存为一个数据文件,数据文件可在程序中打开、编辑和重新保存;
2)用户输入学生信息可随时保存数据文件。
(3)文件打开功能
1)程序只能对当前打开的数据文件进行编辑。
(4)查询功能
1)浏览所有学生信息;
2)按学号查询学生信息;
3)按姓名查询学生信息;
4) 查询一个班总成绩和平均成绩;
5) 查询一个班某一门课总成绩和平均成绩;
6)查询某一门课分数段(<60,60-69,70-79,80-89,>90)学生数。
(5)报表输出功能
1) 按学号输出一个班学生信息:学号、姓名、性别、数学、英语、政治、语文成绩、总成绩,到屏幕和文件。
2) 按总成绩输出从高到低输出学号、姓名信息。
注:以上功能以菜单形式供用户使用,并有一定的容错功能。
3 开发语言环境:
Macrosoft VC++6.0或Turbo C2.0
4 数据结构:
数组或链表
5 程序源代码要求:
(1)函数名、变量名采用英文缩写,使用匈牙利命名法进行自说明;
(2)源代码的书写采用递进格式;
(3)程序行和程序段须有注释。

#include<stdio.h>
#include<malloc.h>
#include<string.h>
#include<stdlib.h>
#define NULL 0
#define LEN sizeof(struct student)
struct student
{
int num;
char name[10];
int score;
struct student *next;
};
int n;
struct student *creat()
{
struct student *head;
struct student *p1,*p2;
p1=p2=(struct student *)malloc(LEN);
printf("请输入数据:\n");
printf("-学号---姓名---成绩-\n");
scanf("%d%s%d",&p1->num,p1->name,&p1->score);
head=NULL;
n=0;
while(p1->num!=NULL)
{
n=n+1;
if(n==1) head=p1;
else p2->next=p1;
p2=p1;
p1=(struct student *)malloc(LEN);
scanf("%d%s%d",&p1->num,p1->name,&p1->score);
}
p2->next=NULL;
return(head);
}
void print(struct student *head)
{
struct student *p;
p=he