- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
《计算机软件编程课程设计》报告
一、设计题目
基于链表实现的学生信息管理系统
二、设计要求
利用VC6或者可视化编程设计一个学生信息管理系统,系统内每个学生的信息不少于5项,可以实现增加学生信息、删除学生信息、按条件查找学生信息、修改指定学生信息、显示学生信息。并且可以将学生信息保存到本地磁盘并实现退出系统再重新进入系统可以查询原有数据。
三、设计思路
基于所学知识局限性以及设计可实现性,此次设计学生信息管理系统将采用线性表中的链式存储结构即单链表来存储,用结构体类型和数组来记录并采用外部文件txt方式记录数据的读取与保存。
系统设计流程图
系统流程图
函数调用程序:
四、设计结果
一源代码:
#includestdio.h
#includestdlib.h
#includestring.h
#includemalloc.h
#includeassert.h
typedef struct student{
int xuehao;
char name[30];
char gender[4];
char age[4];
char major [20];
struct student *next;//next指针变量,指向结构体
}student;
struct student * getMes(){
struct student * head = (struct student *) malloc (sizeof(student)); //开辟新单元
head-next = NULL;
int i = 0;
student a[200];
FILE *f = fopen(student.txt, r);
assert(f!=NULL);
struct student * t = head;
while(fscanf(f,%d%s%s%s%s,a[i].xuehao,a[i].name,a[i].gender,a[i].age,a[i].major)!=EOF){
struct student * stu = (struct student *) malloc (sizeof(student));
//strcpy(stu-xuehao ,a[i].xuehao);将一个字符串复制到另一个字符串
stu-xuehao = a[i].xuehao;
strcpy(stu-name ,a[i].name);
strcpy(stu-gender ,a[i].gender);
strcpy(stu-age ,a[i].age);
strcpy(stu-major ,a[i].major);
t-next = stu;
t = stu;
t-next = NULL;
i++;
}
fclose(f);
return head;
}
int sort(struct student *head){
int i = 0;
struct student *t = head-next;
struct student *p = t-next;
while(t-next){
while(p){
if(p-xuehao t-xuehao){
int xuehao = t-xuehao;
t-xuehao = p-xuehao;
p-xuehao = xuehao;
char name[30];
char gender[4];
char age[4];
char major[20];
strcpy(name,t-name);
strcpy(t-name,p-name);
strcpy(p-name,name);
strcpy(gender,t-gender);
strcpy(t-gender,p-gender);
strcpy(p-gender,gender);
strcpy(age,t-age);
strcpy(t-age,p-age);
strcpy(p-age,age);
strcpy(major,t-major);
strcpy(t-major,p-major);
strcpy(p-major,major);
i++;
}
p = p-next;
}
t = t-next;
p = t-next;
}
return i;
}
void writeMes(struct
您可能关注的文档
最近下载
- 供暖系统施工方案.docx VIP
- 艾瑞咨询:银行4.0时代-2021年中国数字银行白皮书.docx VIP
- other-the-other-the-others-others-another辨析及专项练习.pdf VIP
- 专题08 惯性力(竞赛精练)-2024-2025学年高中物理竞赛能力培优专练(高一上学期)(解析版).docx VIP
- 企业并购动因、绩效及风险文献综述.docx VIP
- 2025高考语文试题(上海卷-含解析).doc VIP
- 专题07 牛顿运动定律(竞赛精练)-2024-2025学年高中物理竞赛能力培优专练(高一上学期)(解析版).docx VIP
- 专题01 运动学的基础内容(竞赛精练)-2024-2025学年高中物理竞赛能力培优专练(高一上学期)(解析版).docx VIP
- AA大学无形资产清查组工作实施方案.docx VIP
- 急危重症的识别和诊疗思维专家讲座.ppt VIP
文档评论(0)