文档详情

C语言图书管理系统实验报告书.doc

发布:2017-02-11约9.86千字共15页下载文档
文本预览下载声明
高级语言(C语言)课程设计说明书 起止日期: 年 月 日 至 年 月 日 学生姓名 班级 成绩 程序的数据结构 这部分主要写本设计所使用的数据结构,比如结构体的定义,单向链表,以及数据输入输出形式(如采用文件的方式读入或保存数据) //自定义枚举类型fi_type,用来表示图书信息 typedef enum _fi_type { news=1, //图书信息 }fi_type; //图书信息结构体 struct fi_info { char name[11]; //书名 char writer[21]; //作者 char shuhao[10]; //书号 char fenlei[10]; //分类 char chuban[20]; //出版社 int chubantime; //出版时间 float price; //价格 fi_type type; struct fi_info* next; //结构体的指针域,用于存放链表的下个结点的地址 }; 程序的函数设计 函数的功能描述 struct fi_info *head=NULL,*head_=NULL ; //将图书信息写成链表,头指针分别为空 int Book_num; //图书信息的统计数 void menu(); int ReadinfoFromFile(); //读入数据 //函数申明 int chuangjian(); //创建新的图书信息 void chazhao(); //查找图书 void shanchu(); //删除图书 void xiugai(); //修改图书 void show(); //查看图书 void paixu() ; //图书排序 void quit(); //退出 函数的调用关系 调用关系为主函数调用各函数。 #includestdio.h #includestdlib.h #includestring.h #includeconio.h //自定义枚举类型fi_type,用来表示图书信息 typedef enum _fi_type { news=1, //图书信息 }fi_type; //图书信息结构体 struct fi_info { char name[11]; //书名 char writer[21]; //作者 char shuhao[10]; //书号 char fenlei[10]; //分类 char chuban[20]; //出版社 int chubantime; //出版时间 float price; //价格 fi_type type; struct fi_info* next; //结构体的指针域,用于存放链表的下个结点的地址 }; struct fi_info *head=NULL,*head_=NULL ; //将图书信息写成链表,头指针分别为空 int Book_num; //图书信息的统计数 int ReadinfoFromFile(); //读入数据 //函数申明 int chuangjian(); //创建新的图书信息 void chazhao(); //查找图书 void shanchu(); //删除图书 void xiugai(); //修改图书 void show(); //查看图书 void paixu() ; //图书排序 void XG(); void main() { //int i; char ch=1; ReadinfoFromFile(); system(cls); system(cls); while(ch!=5) {printf(\n\n\n\n\n); printf(\t\t图书管理系统\n\n\n); printf(\t\t**************MENU*************\n); /*菜单的标题行*/ printf(\t\t1----------------图书信息录入\n); /*输入数据*/ printf(\t\t2----------------显示图书信息\n); /*显示所有记录*/ printf(\t\t3
显示全部
相似文档