文档介绍:《数据结构》课程设计
题
目:
学生作业完成情况管理程序
专
业:
计算机科学与技术
班
级:
学
号:
作者姓名:
指导教师:
2011年12月25日
1、 需求分析 (2)
1问题描述 (2)
2基本要求 (2)
2、 概要设计 (2)
1数据结构 (2)
2程序模块 (3)
2. 3各模块之间的调用关系及算法设计 (3)
3、 详细设计 (4)
4、 调试与分析 (8)
1程序调试 (8)
2数据分析 (9)
5、 用户手册 (10)
1运彳丁环境 (10)
2执彳亍文件 (10)
6、 参考文南犬 (10)
7、 心得体会 (10)
8、 小组成员任务分配及工作进度安排 (11)
学生作业完成情况管理程序
1、需求分析
请设计一个学生作业完成情况管理程序。
假设某门课程一学期要留10次作业,每次老师要进行批改,给出分数后还要进行登记。 学期期末要根据每次作业的成绩计算出最终的平时成绩(满分100)。作业登记信息应该包 含:学号、姓名、10次作业的完成情况。
2基本要求
该程序应该具有下列功能:
通过键盘输入某位学生某次作业的分数;
给定学号,显示某位学生作业完成情况;
给定某个班级的班号,显示该班所有学生的作业完成情况;
给定某位学生的学号,修改该学生的作业完成信息;
给定某位学生的学号,删除该学生的信息;
按学生的最终平时成绩进行排序;
输出平均分数。
2、概要设计
定义了两个结构体studentinfo和stuType分别存储学生的基本信心和所有学生的信息 库。完整定义如下:
struct studentinfo
{ //定义学生基本信息结构体
int num;
int cis:
char* name;
int score[10];
}
struct stuType
{ //结构类型定义
student Info stu[MUNMAX]:
int num;}
2程序模块
void DisplayMenu () ; //显示菜单
int choiceltemO ; //菜单选择
void Print_alnfo(struct stuType s, int index) ; //输出一个学生的信息
void Printinfo (struct stuType s) ; //输出所有学生的信息
void Input_alnfo (struct studentinfo* as) ; //输入一个学生的信息
void Input_alllnfo(struct stuType* s, int num) ; //输入多个学生的信息 int Search (stmct stuType stu); 〃查找
void Modify (struet stuType* s, stuType stu) ; //修改
void del (struct stuType* s) ;//删除
void Search cis (struct stuType* s) ;//查出一个班的成绩
void Pj (struct stuType* s) ;//求平均成绩
2. 3各模块之间的调用关系及算法设计
1、菜单选择函数choiceitem()通过调用显示菜单函数void DisplayMenu ()实现对程序 的基本功能的显示,从而使程序设计有了方向。
2>通过函数choiceitem()的switch语句列举查询的功能,从而实现对程序各模块之 间的调用,详细如下:
do{
choice二choiceItem();
switch (choice)
{
case 0:printf(〃\nWelconie );break;
case 1:Inp1Info(&student, MUNMAX);break;
case 2:Input allInfo(&student, 1); break;
case 3:Printlnfo(student);break;
case 4:Init(&student);break;
case 5:{if((index=Search(student))!二一1)
Print_alnfo(student, index);
else printf (〃\n No eixst the student. \n〃);} break;
case
6:Modify(&student, student);break;
case
7:del (&student);break;
case
8:Searcheds(