微机课设学生成绩管理系统
❶ 求一个学生成绩管理系统课设
用什么语言做?我有asp的学生信息管理系统,里面有学生成绩管理的模块。刚刚毕设做完的,可运行
❷ 学生成绩管理系统的课程设计要怎么做
学生成绩管理系统
俺做好了。需要来取。。
❸ 程序设计一个学生成绩管理系统~~~
|依靠Baihi联系
有时间能处理你的题目
我们可以根据本要求提供一份相当于学生水平的源代码内
6 |容 ES:\\
5 | 交易提醒:预付定金有风险
7 |
1 | 北京易软个人软件
5 | 全职软件开发团队
6 | 十年信誉铸成品质
1 | 速度专业积累效率
5 | 开发信息管理系统更有优惠
❹ 设计一个简单的学生成绩管理系统,
我没写,只能和你说说怎么写。
可以由类模板和数组写。
我说说类模板的吧。
定义一个Student类存放学生信息(姓名,初始排名,各科成绩,个人总分);
初始排名由输入顺序排,在计算名字的时候就可以通过冒泡排序。
在里面定义计算总分的函数。
下面定义一个Caozuo类,用学生链表的做。你可以去找下这个例子。
数组的就很简单了,你只要想想。先定义数组(姓名,成绩),总分就是个人每科成绩的和,下面5个函数都可以通过数组遍历实现。如
cout<<"请输入你要查询的学生的名字:"<<endl;
cin>>n;
for(int i=0;i<=Maxsize;i++)
{
if(Student[i].name==n)
Student[i].Print();
}
❺ c语言课程设计 学生成绩管理系统
我来帮你~\(≧▽≦)/~啦,请问问题解决了吗?
❻ 求(C语言课程设计)学生成绩管理系统
#include "stdio.h"
#include "conio.h"
#include "string.h"
#include "stdlib.h"
#define CMD_START printf("\n\n######### Start a command #########\n");
/* 用来标记一个命令执行的开始 */
#define CMD_END printf( "\n######### End a command #########\n\n");
/* 用来标记一个命令执行的结束
,这两个语句是为了提供更好的用户界面而写的 */
#define DATA_FILE "data.dat"
/* 这是 数据文件名 */
#define TEMP_FILE "temp.dat"
/* 这是一个临时的文件的名字,在删除记录的函数中使用的,
详细内容参考 Delete() 函数 */
typedef struct tagStudent
{
char ID[30]; /* 学号 */
char Name[30]; /* 姓名 */
char Class[255]; /* 班级 */
char Sex; /* 性别 ,值为 F 或 f 或 M 或 m */
int Math; /* 数学成绩 */
int English; /* 英语成绩 */
int Compute; /* 计算机成绩 */
int Philosophy; /* 哲学成绩 */
int PE; /* 体育成绩 */
} Student;
/* 这是学生信息结构体 */
int ShowMenu(); /* 在屏幕上打印 主菜单
的函数,它的返回值为 所选
菜单的 项目编号 */
int ReadData(FILE *, Student *); /* 从一个
打开的数据文件中读取
记录的函数,错误返回 0 */
int WriteData(FILE *, Student *); /* 向一个数据文件中 写入
记录的函数,错误返回 0 */
void Output_Rec(Student *); /* 在屏幕上 打印 一条记录 */
void Input_Rec(Student *); /* 让用户输入 记录的 各个项目的
值,在添加记录时用到了 */
void CopyRec(Student *, Student *); /* 复制一条记录 到
另一个记录中 */
/* 题目中要求的函数 */
void Print(); /* 实现查看数据文件内容的函数 */
void Add(); /* 添加记录的函数 */
void Delete(); /* 删除记录的函数 */
void Statistics(); /* 对数据进行统计分析的函数 */
void Find(int); /* 实现查找功能的函数,参数决定
是按 ID 查找 还是按 Name 查找 */
int quit; /* 一个全局变量,在下面的 main()
函数中,用来决定何时退出主循环
*/
main()
{
int cmd; /* 用户所选的 菜单 项目 的标号 */
quit = 0; /* 初始化 为 不退出 */
/* 这是程序的主循环,每次都将 主菜单打印出来,
供用户选择相应的 序号 来执行相应的功能 */
while (!quit)
{
cmd = ShowMenu(); /* 显示
主菜单,并返回用户所选择的
菜单项 的 编号 */
CMD_START /* 在屏幕上打印一行分隔符,告诉用户这是一个子功能的开始
*/
switch (cmd) /* 用多项分支 根据 用户的选择
调用 相应的函数 */
{
case 1:
Print();
break; /* 用户选择 1 号菜单,程序执行
查看的数据文件的函数 */
case 2:
Add();
break; /* 用户选择 2 号菜单,程序执行
添加记录的函数 */
case 3:
Delete();
break; /* 用户选择 3 号菜单,程序执行
删除记录的函数 */
case 4:
Statistics();
break; /* 用户选择 4 号菜单,程序执行
统计数据的函数 */
case 5:
Find(5);
break; /* Find_ID ,5 号菜单执行 按
ID(学号)查找的功能 */
case 6:
Find(6);
break; /* Find_Name,6 号菜单执行 按
Name(姓名)查找的功能 */
case 7:
quit = 1; /* 用户选择了退出菜单 */
printf
(" Thank you for your using .\n\n Happy everyday !!\n\n Bye Bye ....\n");
break;
default:
printf(" Please Input a number between\t1\tto\t7.\n");
/* 用户所输入的 序号不在所处理的范围内 */
}
CMD_END /* 打印一行分隔符,告诉用户
他所选择的菜单的功能已经执行完毕
*/
if (quit != 1) /* 检查用户是否 要求 退出 */
{
printf(" Press any key to Return Main Menu ....\n");
getch(); /* 用 一个 无回显 的 字符输入函数
来实现暂停执行,按 任意键
继续的功能 */
}
}
}
int ShowMenu()
{
int cmd = 0; /* 保存用户的选择 */
/* 定义 程序所支持的菜单项目 */
char Menu_SeeData[] = "\t1 .\tView the Records in the data file\n"; /* 查看数据文件
*/
char Menu_Add[] = "\t2 .\tAdd New Record\n"; /* 添加记录 */
char Menu_Delete[] = "\t3 .\tDelete an old Record\n"; /* 删除记录 */
char Menu_Statistics[] = "\t4 .\tMake a Statistics\n"; /* 统计分析 */
char Menu_Find_ID[] = "\t5 .\tFind a Record from the ID\n"; /* 按
学号(ID)
查找 */
char Menu_Find_Name[] = "\t6 .\tFind a Record from the Name\n"; /* 按
姓名(Name)
查找 */
char Menu_Quit[] = "\t7 .\tQuit\n"; /* 退出 */
/* 在屏幕上打印 主菜单 */
printf("\n\n############ Main Menu ###############\n");
printf("##############################################\n\n");
printf(Menu_SeeData);
printf(Menu_Add);
printf(Menu_Delete);
printf(Menu_Statistics);
printf(Menu_Find_ID);
printf(Menu_Find_Name);
printf(Menu_Quit);
printf("\n##############################################");
printf("\n\n Input the index of your choice : ");
scanf("%d", &cmd); /* 接受用户 选择 */
printf("\n");
return cmd; /* 返回用户的输入,交给主循环处理
*/
}
void Print() /* 打印 数据文件的 记录内容 */
{
FILE *fp = NULL; /* 文件指针 */
Student rec; /* 存放从文件中读取的记录 */
int i = 0; /* 实现 计数 和 分屏打印的功能 */
fp = fopen(DATA_FILE, "rb"); /* 以 二进制读 方式
打开数据文件 */
if (fp == NULL) /* 打开文件出错 */
{
printf(" Can not open the data file : %s\n", DATA_FILE);
return;
}
while (ReadData(fp, &rec)) /* ReadData()
函数出错或到文件末尾时返回
0,可以做循环条件 */
{
Output_Rec(&rec); /* 正确读取,将记录输出 */
printf(" ------------------------------------------");
/* 打印一行分隔符,营造好的用户界面 */
i ; /* 计数器 加一 */
if (i % 4 == 0) /* 显示 4 个暂停一下 */
{
printf("\n Press any key to continue ... \n");
getch();
}
}
printf("\n The current data file have\t%d\trecord .\n", i);
fclose(fp); /* 关闭文件 */
}
void Add() /* 添加记录 */
{
Student rec;
FILE *fp = NULL;
Input_Rec(&rec); /* 让用户输入新记录的各项内容 */
fp = fopen(DATA_FILE, "ab"); /* 以 添加 方式打开数据文件 */
if (fp == NULL)
{
printf(" Can not open the data file to write into ... \n");
return;
}
if (WriteData(fp, &rec) == 1) /* 将 新记录 写入文件,并检查
是否正确写入 */
printf("\n\n Add New Record Success \n\n");
else
printf("\n\n Failed to Write New Record into the data file \n");
fclose(fp);
}
void Delete() /* 删除记录 */
{
Student rec;
FILE *fpr, *fpw; /* 两个文件指针,分别用于 读 和
写 */
char buf[30]; /* 接受 用户输入的 ID 缓冲区 */
char cmd[255]; /* 执行的系统命令 */
int del_count; /* 实际 删除的 记录数目 */
del_count = 0;
printf("\n Please type the ID of the record you want me to delete .");
printf("\n The ID : "); /* 提示用户 输入 */
scanf("%s", buf);
fpr = fopen(DATA_FILE, "rb"); /* 从
原来的记录文件中读取数据,跳过将要删除的记录
*/
if (fpr == NULL)
{
printf(" Can not open the data file to read record ... \n");
return;
}
fpw = fopen(TEMP_FILE, "wb"); /* 打开一个 临时文件
保存不删除的记录 */
if (fpw == NULL)
{
printf(" Can not open the data file to write into ... \n");
return;
}
while (ReadData(fpr, &rec)) /* 读取 要保留的记录 */
{
if (strcmp(rec.ID, buf) != 0)
{
WriteData(fpw, &rec); /* 写入临时文件 ,然后删除
原数据文件,
再将临时文件该名为原数据文件的名字
*/
}
else
{
del_count ; /* 跳过的记录数目,即删除的数目 */
}
}
fclose(fpr);
fclose(fpw);
strcpy(cmd, "del "); /* 构造命令串,用 system() 函数执行
*/
strcat(cmd, DATA_FILE);
system(cmd);
rename(TEMP_FILE, DATA_FILE); /* 直接调用 C
语言的改名函数将临时文件改名为数据文件的名字
*/
printf("\n I have delete\t%d\trecord .\n", del_count);
}
void Statistics() /* 统计分析函数 */
{
int i50, i60, i70, i80, i90; /* 平均分小于60
,60-69,70-79,80-89,>=90
的分数段的学生数目 */
float avg; /* 平均分 */
int sum, sum_high, sum_low; /* 总分,总分最高分,总分最低分 */
Student stu_high, stu_low; /* 总分最高和最低 学生的信息 */
Student stu_math_high, stu_english_high; /* 各科
最高分的学生记录副本
*/
Student stu_compute_high, stu_philosophy_high, stu_PE_high;
Student stu_math_low, stu_english_low; /* 各科最低的学生记录副本
*/
Student stu_compute_low, stu_philosophy_low, stu_PE_low;
FILE *fp;
Student rec;
int count; /* 一个计数器,用于判断是否第一次读取数据
*/
count = sum = sum_high = sum_low = i50 = i60 = i60 = i70 = i80 = i90 = 0;
fp = NULL; /* 对 数据初始化 */
fp = fopen(DATA_FILE, "rb");
if (fp == NULL)
{
printf("\nCan not open the data file to read ...\n");
return;
}
while (ReadData(fp, &rec)) /* 读取数据 */
{
count ; /* 计数器 加一 */
sum = rec.Math rec.English rec.Compute rec.PE rec.Philosophy; /* 求和
*/
/* average */
avg = ((float)sum) / 5; /* 平均分 */
/* 下面对各个分数段进行统计 */
if (avg < 60)
i50 ;
else if (avg < 70)
i60 ;
else if (avg < 80)
i70 ;
else if (avg < 90)
i80 ;
else
i90 ;
/* highest and loeest */
if (count <= 1) /* 第一次读取,执行初始化,不进行比较
*/
{
sum_high = sum_low = sum;
CopyRec(&stu_high, &rec);
CopyRec(&stu_low, &rec);
}
else
{
if (sum > sum_high)
{
sum_high = sum; /* 得到最高总分 */
CopyRec(&stu_high, &rec); /* 保存总分最高的学生的信息
*/
}
if (sum < sum_low)
{
sum_low = sum; /* 得到最低分 */
CopyRec(&stu_low, &rec); /* 保存总分最低的学生的信息
*/
}
}
/* subject highest and low */
if (count == 1) /* 同上面一样,执行初始化 */
{
CopyRec(&stu_math_high, &rec);
CopyRec(&stu_english_high, &rec);
CopyRec(&stu_compute_high, &rec);
CopyRec(&stu_philosophy_high, &rec);
CopyRec(&stu_PE_high, &rec);
CopyRec(&stu_math_low, &rec);
CopyRec(&stu_english_low, &rec);
CopyRec(&stu_compute_low, &rec);
CopyRec(&stu_philosophy_low, &rec);
CopyRec(&stu_PE_low, &rec);
}
else
{
/* High */
/* 保存各科的最高分的学生的信息 */
if (rec.Math > stu_math_high.Math)
CopyRec(&stu_math_high, &rec);
if (rec.English > stu_english_high.English)
CopyRec(&stu_english_high, &rec);
if (rec.Compute > stu_compute_high.Compute)
CopyRec(&stu_compute_high, &rec);
if (rec.Philosophy > stu_philosophy_high.Philosophy)
CopyRec(&stu_philosophy_high, &rec);
if (rec.PE > stu_PE_high.PE)
CopyRec(&stu_PE_high, &rec);
/* low */
/* 保存各科的最低分的学生的信息 */
if (rec.Math < stu_math_low.Math)
CopyRec(&stu_math_low, &rec);
if (rec.English < stu_english_low.English)
CopyRec(&stu_english_low, &rec);
if (rec.Compute < stu_compute_low.Compute)
CopyRec(&stu_compute_low, &rec);
if (rec.Philosophy < stu_philosophy_low.Philosophy)
CopyRec(&stu_philosophy_low, &rec);
if (rec.PE < stu_PE_low.PE)
CopyRec(&stu_PE_low, &rec);
}
} /* While End */
if (count < 1)
{
printf("\n There is no record in the data file .\n");
}
else
{
/* average */
/* 输出平均分的分段统计信息 */
printf("\n The count in each segment :\n");
printf("\t < 60\t:\t%d\n", i50);
printf("\t60 - 69\t:\t%d\n", i60);
printf("\t70 - 79\t:\t%d\n", i70);
printf("\t80 - 90\t:\t%d\n", i80);
printf("\t >= 90\t:\t%d\n", i90);
printf(" ------------------------------------------");
getch();
/* highest and loeest */
/* 输出总分最高的学生的信息 */
printf("\n The Highest Mark Student:\n");
printf(" The Mark is : %d\n", sum_high);
printf(" The student is :\n");
Output_Rec(&stu_high);
/* 输出总分最高的学生的信息 */
printf("\n The Lowest Mark Student:\n");
printf(" The Mark is : %d\n", sum_low);
printf(" The student is :\n");
Output_Rec(&stu_low);
printf(" ------------------------------------------\n");
getch();
/* subject highest and low */
/* 输出各科最高和最低分的统计信息 */
printf(" The Highest\tMath :\n");
Output_Rec(&stu_math_high);
printf(" The Lowest Math :\n");
Output_Rec(&stu_math_low);
printf(" ------------------------------------------\n");
getch(); /* 暂停 ,按任意键继续 */
printf(" The Highest English :\n");
Output_Rec(&stu_english_high);
printf(" The Lowest English :\n");
Output_Rec(&stu_english_low);
printf(" ------------------------------------------\n");
getch();
printf(" The Highest Compute :\n");
Output_Rec(&stu_compute_high);
printf(" The Lowest Compute :\n");
Output_Rec(&stu_compute_low);
printf(" ------------------------------------------\n");
getch();
printf(" The Highest Philosophy :\n");
Output_Rec(&stu_philosophy_high);
printf(" The Lowest Philosophy :\n");
Output_Rec(&stu_philosophy_low);
printf(" ------------------------------------------\n");
getch();
printf(" The Highest PE :\n");
Output_Rec(&stu_PE_high);
printf(" The Lowest PE :\n");
Output_Rec(&stu_PE_low);
printf(" ------------------------------------------\n");
}
fclose(fp);
}
void Find(int isFind_From_ID) /* 查找函数 */
{
char buf[30]; /* 接受用户输入的条件的缓冲区 */
Student rec;
int find_count; /* 查找到的记录数目 */
FILE *fp;
find_count = 0;
fp = fopen(DATA_FILE, "rb");
if (fp == NULL)
{
printf("\n Can not open the data file to search ...\n");
return;
}
switch (isFind_From_ID)
{
case 5: /* ID,按 学号查找 */
printf("\n Please Input the ID : ");
scanf("%s", buf); /* 提示用户输入 */
while (ReadData(fp, &rec)) /* 读取数据 */
{
if (strcmp(rec.ID, buf) == 0) /* 比较 */
{
find_count ;
Output_Rec(&rec); /* 输出符合条件的记录 */
printf(" ------------------------------------------\n");
}
}
break;
case 6: /* Name ,按 姓名 查找 */
printf("\n Please Input the Name : ");
scanf("%s", buf);
while (ReadData(fp, &rec))
{
if (strcmp(rec.Name, buf) == 0)
{
find_count ;
Output_Rec(&rec);
printf(" ------------------------------------------\n");
}
}
break;
default:
printf(" \nPlease type right index ...\n"); /* 处理isFind_From_ID既不是5也不是6的情况
*/
}
if (find_count > 0) /* 输出找到的记录数目 */
{
printf("\n Have find out\t%d\trecord\n", find_count);
}
else
{
printf
("\n I'm very sorry .\n I failed to find out the one you want .\n");
printf("\n I suggest that you change some other key words .\n");
}
fclose(fp);
}
int ReadData(FILE * fp, Student * Dest_Rec) /* 读取数据记录 */
{
int r;
if ((fp == NULL) || (Dest_Rec == NULL))
return 0; /* ERROR */
r = fread(Dest_Rec, sizeof(Student), 1, fp);
if (r != 1)
return 0;
return 1;
}
int WriteData(FILE * fp, Student * Src_Rec) /* 写入数据记录 */
{
int r;
if ((fp == NULL) || (Src_Rec == NULL))
return 0; /* ERROR */
r = fwrite(Src_Rec, sizeof(Student), 1, fp);
if (r != 1)
return 0;
return 1;
}
void Output_Rec(Student * stu) /* 在屏幕上输出 一个学生的信息 */
{
printf("\n");
printf(" Name : %s", stu->Name);
printf("\t\tSex : ");
if (stu->Sex == 'M' || stu->Sex == 'm')
printf("Male");
else
printf("Female");
printf("\n ID : %s\t\tClass : %s\n", stu->ID, stu->Class);
printf("Math = %d\tEnglish = %d\tCompute = %d\n", stu->Math, stu->English,
stu->Compute);
printf("Philosophy = %d\t\tPE = %d\n", stu->Philosophy, stu->PE);
printf("\n");
}
void Input_Rec(Student * stu) /* 让用户输入 一个学生的各项信息
*/
{
if (stu == NULL)
return;
printf("\n Name = ");
scanf("%s", stu->Name);
/* 下面这段代码实现只能输入 F ,f ,M ,m 的功能 */
printf("\tSex = (F|M) ");
while (1)
{
stu->Sex = getch(); /* 无回显输入 */
if (stu->Sex == 'F' || stu->Sex == 'f' || stu->Sex == 'M'
|| stu->Sex == 'm')
{
printf("%c", stu->Sex); /* 将用户输入的字符输出,模拟正常输入数据时的回显
*/
break;
}
}
/* 下面 给出提示,让用户输入结构体的各项内容 */
printf("\n ID = ");
scanf("%s", stu->ID);
printf("\n Class = ");
scanf("%s", stu->Class);
printf("\n Math = ");
scanf("%d", &(stu->Math));
printf("\n English = ");
scanf("%d", &(stu->English));
printf("\n Compute = ");
scanf("%d", &(stu->Compute));
printf("\n Philosophy = ");
scanf("%d", &(stu->Philosophy));
printf("\n PE = ");
scanf("%d", &(stu->PE));
printf("\n");
}
/* 因为结构体不能直接用 等号(=)赋值,写一个赋值函数 */
void CopyRec(Student * dest_stu, Student * src_stu)
{
/* 复制 源记录 的各项到 目标记录 */
strcpy(dest_stu->Name, src_stu->Name);
strcpy(dest_stu->ID, src_stu->ID);
strcpy(dest_stu->Class, src_stu->Class);
dest_stu->Sex = src_stu->Sex;
dest_stu->Math = src_stu->Math;
dest_stu->English = src_stu->English;
dest_stu->Compute = src_stu->Compute;
dest_stu->Philosophy = src_stu->Philosophy;
dest_stu->PE = src_stu->PE;
}
/*
题目分析 及 算法设计 :
题目中的各个功能都是相对独立的,所以我将各项功能以
带 编号 的菜单形式组织在屏幕上,用户通过 输入 编号
执行相应的功能。显示菜单的代码处于一个循环之中,当执行完一个子功能后,就又回到循环,显示主菜单,直到用户选择
退出 菜单。 这种操作方式比其它机制(如:主程序
程序参数)更简捷,不必每次用不同的参数重新运行程序,以实现相应的功能。
1. 查看文件记录内容的实现: 用循环读取文件内容,然后显示在屏幕上。
因为我们的数据是以结构体的形式存放在文件中的,所以
代码中用了块读取和块写入函数。 在循环中设置计数器来统计记录的个数。 2.
添加记录的实现:
让用户根据屏幕提示输入数据,完成对学生信息结构体各项的赋值,待取得足够数据后,将数据文件以“追加”方式打开,执行块写入,将整个结构体写入文件。
3. 删除记录的实现:
学号(ID)一般不会重复,所以我在程序中让用户输入想要删除的记录的学号(ID),然后在文件中查找,如果不是用户想要删除的记录(即ID不同),就保存在一个临时的文件中,这样,就将想要删除的记录与其它记录分离开了,最后,删除原来的数据文件,将临时文件的名字改为
原来数据文件的名字。 4. 统计功能的实现:
统计功能模块分为三个小模块:平均分的分数段统计,总分的最高和最低分统计,各科的最高和最低分统计。但我并不想分别来写,因为它们都要对所有记录进行扫描,而它们又互不干扰,所以我把它们组织在一个循环中,各自都有自己的计算代码和变量,所以这个
函数 中的局部变量 很多。 5. 查找功能的实现: 题目要求两种查找方式:按 学号(ID) , 按 姓名(Name)。 两者是独立的,所以我用了一个参数 isFind_From_ID
来表明是哪种查找方式,进而在在程序内部由一个 switch() 选择分支转向不同的代码段去执行。
具体的查找就是比较相应的项目是否与用户输入的一样,若一样就输出到屏幕。 */
❼ 学生成绩管理系统课程设计
你好,我曾用c++学生成绩管理系统的程序,希望能对你有所帮助。
#include <string.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
/*------------------------------------定义类部分------------------------------------------------*/
class Node
{
char name[10];
int score;
class Node *next;
public:
Node* CreateNode(int n);
void PrinfListNode(Node *h);
void InsertList(Node *h,int i,char name[],int e,int *n);
void DeleteList(Node *h,int i,int *n);
Node* operator +=(Node *p);
Node *Unique(Node *p,int *n);
};
void DisplayNote(void);
/*--------------------建立单链表的成员函数,单链表节点的个数不确定--------------------------------*/
Node *Node::CreateNode(int n)
{
Node *head;
Node *pre,*p;
int i;
head=(Node*)malloc(sizeof(Node)); //用malloc动态申请内存,个数作为函数的输入参数
head->next=NULL;
pre=head;
for (i=1;i<=n;i++)
{
printf("请输入学生姓名:",i);
p=(Node*)malloc(sizeof(Node));
scanf("%s",p->name);
printf("请输入此学生的分数:",i);
scanf("%d",&p->score);
pre->next=p;
pre=p;
}
p->next=NULL;
return head;
}
/*---------------------------------输出链表函数实现部分------------------------------------------*/
void Node::PrinfListNode(Node *h)
{
Node *p;
p=h->next;
while(p)
{
printf("name:%s\tscore:%d",p->name,p->score);
p=p->next;
printf("\n");
}
}
/*----------------------------实现单链表的插入操作的成员函数--------------------------------------*/
void Node::InsertList(Node *h,int i,char name[],int e,int *n)
{
Node *p,*q;
int j;
if (i<1||i>(*n)+1)
{
printf("出错啦!请重试!.\n");
}
else
{
j=0;p=h;
while(j<i-1)
{
p=p->next;
j++;
}
q=(Node *)malloc(sizeof(Node));
strcpy(q->name,name);
q->score=e;
q->next=p->next;
p->next=q;
(*n)++;
}
}
/*-----------------------------实现单链表的删除操作的成员函数-------------------------------------*/
void Node::DeleteList(Node *h,int i,int *n)
{
Node *p,*q;
int j;
char name[10];
int score;
if (i<1||i>(*n))
{
printf("出错啦!请重试!.\n");
}
else
{
j=0;p=h;
while(j<i-1)
{
p=p->next;
j++;
}
q=p->next;
p->next=q->next;
strcpy(name,q->name);
score=q->score;
free(q);
(*n)--;
}
}
/*--------------------------重载运算符“+=”实现两个链表对象合并功能------------------------------*/
Node *Node::operator +=(Node *p)
{
Node *q=this;
while(q->next!=NULL) //把第一个链表最后的next指向第二个的头
{
q=q->next;
}
q->next=p->next;
return this;
}
/*----------------编写Unique()成员函数,实现剔除链表中重复元素,使所有节点值唯-----------------*/
Node *Node::Unique(Node *p,int *n)
{ Node *q=this,*k,*m;
int i;
if((*n)<=1) //用循环,拿一个和每一个去比较,一样的删除使用已经写好的删除函数
cout<<"ERROR!"<<endl;
else
{
for(i=1;i<(*n);q=q->next)
{
k=q;
p=q->next;
while(p!=NULL)
{
if(strcmp(q->name,p->name)==0)
{
m=p;
p=p->next;
k->next=m->next;
free(m);
(*n)--;
}
else{
k=p;
p=p->next;
}
}
}
}
return this;
}
/*--------------------------------编写主函数测试上述功能---------------------------------------*/
int main()
{
Node *h,*k;
int i=1,n,score;
char name[10];
int *m=0;
while(i)
{
DisplayNote();
scanf("%d",&i);
switch(i)
{
case 1:
printf("请输入表中成员的个数:\n");
scanf("%d",&n);
h=h->CreateNode(n);
printf("表中成员为:\n");
h->PrinfListNode(h);
break;
case 2:
printf("请写出成员的位置:");
scanf("%d",&i);
printf("请输入学生姓名:");
scanf("%s",&name);
printf("请输入学生分数:");
scanf("%d",&score);
h->InsertList(h,i,name,score,&n);
printf("表中成员为:\n");
h->PrinfListNode(h);
break;
case 3:
printf("请写出成员的位置:");
scanf("%d",&i);
h->DeleteList(h,i,&n);
cout<<"表中成员为:\n";
h->PrinfListNode(h);
break;
case 4:
printf("表中成员为:\n");
h->PrinfListNode(h);
break;
case 5:
printf("请输入另一个表中成员的个数:\n");
scanf("%d",&n);
k=k->CreateNode(n);
h=h->operator +=(k);
printf("两个链表相加之后的链表是:\n");
h->PrinfListNode(h);
break;
case 6:
h=h->Unique(h,&n);
printf("剔除重复元素后的新链表是:\n");
h->PrinfListNode(h);
break;
case 0:
return 0;
break;
default:
printf("出错啦!请重试!");
}
}
return 0;
}
void DisplayNote(void)
{
printf("1--建立新的链表\n");
printf("2--添加元素\n");
printf("3--删除元素\n");
printf("4--输出当前链表中的内容\n");
printf("5--两个链表对象合并\n");
printf("6--剔除链表中重复元素\n");
printf("0--退出\n");
}
❽ 我的计算机毕业设计题目是学生成绩管理系统,这个系统应该包含哪些功能呢
本系统设计的是一个学生成绩管理系统,主要是按照学生成绩管理问题,来开发的一个小系统,目标是使学生管理的工作人员在平时的管理中也做到数据的信息化、快速化和网络化。本系统经过简单扩充就可以成为一个完整的学生成绩管理系统。下面来说一下本程序的各个模块的功能。本程序由登录界面、主窗口、用户管理、学生档案管理模块、班级管理模块、课程管理模块、成绩管理模块等部分组成。 http://www.lw777.net/a/jisuanji/vb/2010/1010/265.html你到三七论文网参考一下,里面有很多资料可以学习。
❾ 学生成绩管理系统课程设计.
#include <iostream>#include <stdio.h>#include <string.h>#include <conio.h>#include <iostream>#include <ctime>using namespace std;#define max 100
//////////////////////////////////////////////////////////////////////////strcut stustruct stu //学生资料结构体{ char name[10]; char num[20]; //学号 char adress[8]; float x,y,z,score; int number;};
//////////////////////////////////////////////////////////////////////////////student.cppint count=0;int temp=0;int Exchang=0; //定义数据修改标志,若修改则为1,否则为0class student //学生类{private: stu data[max]; char start_del;public: void input(char *ch1,char *num,char *ch2,float x,float y,float z); //输入 void find(char *num); //查找 void del(char *num); //删除 int check_num(char *num) //确定没有重复学号 { int m=0; while(m<=count) if(!strcmp(num,data[m++].num)) //判断是否相同 break; if(m>count) return 0; else return 1; } void taxis(); //总分排序 void show(); void save(); //保存学生资料 void read(); //从文件"student"读取学生资料};
void student::input(char *ch1,char *num,char *ch2,float x,float y,float z){ strcpy(data[count].name,ch1); strcpy(data[count].num,num); strcpy(data[count].adress,ch2); data[count].x=x; data[count].y=y; data[count].z=z; count++; Exchang=1; //设置已修改数据标志}void student::find(char * num){ int m=0; while(m<=count) if(!strcmp(num,data[m++].num)) break; if(m>count) { cout << "很抱歉,没有该学号的学生" << endl; start_del='n'; getch(); } else { temp=count; count=m; start_del='y'; cout << "该学生的资料为" <<endl << "序号\t姓名\t学号\t\t地址\t\t\t高数\t英语\t计算机" << endl; show(); count=temp; getch(); }}void student::del(char *num){ char chose; find(num); if(start_del=='y') {
cout << "确实要删除该学生资料? Y/N" << endl; cin >> chose; if(chose=='y') { int m=0; while(m<count) if(strcmp(num,data[m++].num)==0) //错在这里 break; temp=count; count=m; if(temp==count) { count=temp-1;printf("2"); cout << "该学生资料已删除" << endl; Exchang=1; //设置已修改数据标志 } else { while(count<temp) { strcpy(data[count-1].name,data[count].name); strcpy(data[count-1].num,data[count].num); strcpy(data[count-1].adress,data[count].adress); data[count-1].x=data[count].x; data[count-1].y=data[count].y; data[count-1].z=data[count].z; count++;
}printf("1"); count=temp-1; cout << "该学生资料已删除" << endl; Exchang=1; //设置已修改数据标志 } } else cout << "学生资料未删除" << endl; getch();
}}void student::taxis(){ int x,y,array[max]; int change; for(x=0;x<count;x++) array[x]=data[x].score=data[x].x+data[x].y+data[x].z; for(x=0;x<count-1;x++) for(y=0;y<count-1-x;y++) if(array[y]<array[y+1]) { change=array[y]; array[y]=array[y+1]; array[y+1]=change; } cout << "总分\t姓名\t学号\t\t地址\t\t高数\t英语\t计算机" << endl; for(x=0;x<count;x++) for(y=0;y<count;y++) if(array[x]==data[y].score) { cout << data[y].score << "\t" << data[y].name << "\t" << data[y].num << "\t" << data[y].adress << "\t" << data[y].x << "\t" << data[y].y << "\t" << data[y].z << endl; } getch(); Exchang=1; //设置已修改数据标志}
void student::show(){ cout << count << "\t" << data[count-1].name << "\t" << data[count-1].num << "\t" << data[count-1].adress << "\t\t" << data[count-1].x << "\t" << data[count-1].y << "\t" << data[count-1].z << endl;}
//////////////////////////////////////////////////////////////////////main.cppvoid main(){ student st; char *ch1,*ch2,chose; char flag[2],num[20],find[20],del[20]; char ch;
float x,y,z; time_t t; time(&t);
while(1) { system("cls"); cout << "------------------------学生管理系统------------------------" <<endl
<< " 1.输入/添加学生资料 "<<endl << " 2.输出学生资料" <<endl << " 3.查找 " <<endl << " 4.删除" <<endl << " 5.总分排序" <<endl << " 6.退出" << endl << endl << " 请选择你要的服务(1-6)" << endl; cin >> chose; if(chose=='6') { break; } switch(chose) { case '1': // 输入学生信息 { do { cout << "请输入学生姓名:" << endl; ch1=new char[]; ch2=new char[]; cin >> ch1 ; cout << "请输入学号:" << endl; cin >> num ; while(st.check_num(num)) { cout << "学号重复,请重新输入" << endl; cin >> num; } cout << "请输入地址:"<<endl; cin >> ch2 ; cout << "请输入高数成绩:"<<endl; cin >> x; cout << "请输入英语成绩:" <<endl; cin >> y; cout << "请输入计算机成绩:" <<endl; cin >> z; st.input(ch1,num,ch2,x,y,z); printf("\n是否继续输入学生信息?(\"y\"继续)"); scanf("%s", flag); }while(strcmp(flag, "y") == 0); }break; case '2':// 输出学生资料 { temp=count; count=1; cout << "序号\t姓名\t学号\t\t地址\t\t\t高数\t英语\t计算机" << endl; while(count<=temp) { st.show(); count++; } count--; getch(); }break; case '3': { cout << "请输入你要查找学生的学号" << endl; cin >> find; st.find(find); }break; case '4': { cout << "请输入你要删除的学生学号" << endl; cin >> del; st.del(del); }break; case '5': { st.taxis(); }break;
default: { cout << "输入错误!!!,请重新输入" << endl; getch(); } } } cout << "感谢你的使用!\n" <<endl; getch();
}