如何用C语言编写学生成绩管理程序

来源:百度知道 编辑:UC知道 时间:2024/05/28 18:23:33
假设有一个班级学生n人,期末考试老师要对成绩从高到低列出,并对各科的考试成绩求出其最高分、最低分和平均成绩。试设计一个成绩管理程序,按要求显示输出学生的记录和相关的成绩。
(1)学生成绩的数据来源于程序的结构数组,定义若干个(不少于10)学生的记录,学生记录包括:学号、姓名、三至五门科目的考试成绩;
(2)使用一种排序算法对上述某门科目的成绩进行排序;
(3)将排序后的成绩,以每个学生记录的形式显示输出;
(4)求出每门科目的最高分、最低分和平均分的信息;
(5)输出的数据要清晰,排列整齐。

#include<stdio.h> /*引用库函数*/
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
typedef struct /*定义结构体数组*/
{
char num[10]; /*学号*/
char name[20]; /*姓名*/
int score; /*成绩*/
}Student;
Student stu[80]; /*结构体数组变量*/
int menu_select() /*菜单函数*/
{
char c;
do{
system("cls"); /*运行前清屏*/
printf("\t\t****Students' Grade Management System****\n"); /*菜单选择*/
printf("\t\t | 1. Input Records |\n");
printf("\t\t | 2. Display All Records |\n");
printf("\t\t | 3. Sort |\n");
printf("\t\t | 4. Insert a Record |\n");
printf("\t\t | 5. Delete a Record |\n");
printf("\t\t | 6. Query |\n");
printf("\t\t | 7. Statistic |\n");
printf("\t\t | 8.