C语言图书管理系统源代码

合集下载

C语言程序课程设计图书管理系统方案

C语言程序课程设计图书管理系统方案

C语言程序课程设计报告标题:图书管理系统专业:软件工程类:设计主题图书馆管理系统主要包括管理图书的库存信息,每本书的借阅信息,每个人的借阅信息。

每本书的库存信息包括数量、书名、作者、出版日期、金额、类别、总入库数量、当前库存、已借出图书数量等。

每本借书包括以下信息:编号、书名、金额、借书证号、借阅日期、到期日期、罚款金额等。

每个人的图书馆信息包括借书证号、班级、学号等。

该系统的功能包括以下几个方面:一、借阅资料管理要求对图书、期刊、报纸、期刊进行分类管理,这样操作会更加灵活方便。

可以随时添加、删除、修改、查询等相关资料。

b、借贷管理(1)借贷操作(2)还书操作(3)更新治疗提示:以上处理需要相互配合,通过编辑赔偿和违约金金额来完成图书借还业务的各种登记。

例如,读者在还书时,不仅要更新图书的库存信息,还要自动计算图书的罚款金额。

并显示读者当天到期未还图书的所有信息。

c、读者管理读者等级:对借阅的读者进行分类,比如可以分为教师和学生两类。

并定义每类读者可以借阅的图书数量及相关借阅时间等信息。

读者管理:可以录入读者信息,以及挂失或注销读者、查询等服务。

D.统计分析可以随时进行统计分析,及时了解当前的借阅情况和相关数据状态。

统计分析包括借阅列表、数据状态统计、借阅统计等功能分析,显示当日所有到期未还的图书信息。

e系统参数设置:您可以设置相关的系统服务器参数,如违约金金额、最大借用天数等。

根据题目分析这项工作分为六个模块。

1.图书数据2.借款人信息3.借用模块4.还书模块5.照看书籍6.查询模块模块一:书号,书名,作者,出版时间,价格,份数,页数。

模块二:单位、借阅书目、借阅时间模块3:输入书名、书号、借书证。

模块四:登记书号,还书,处理罚款。

模块5:管理书库中的书籍,将新书入库,删除旧书,堆栈查询模块6:图书查询。

数据测试源代码汉字菜单可以参照以下代码编写:#包含“stdio.h”。

主(){ char c;int I;做{clr SCR();for(I = 0;i < 80i++)printf(" * ");printf("\t 1:添加书籍\ n ");printf("\t 2:列出书籍\ n ");printf(" \ t 3:s reach books \ n ");printf("\t 4:借书\ n ");printf("\t 5:返回图书\ n ");printf("\t6:退出\n ")printf(" \ t请选择输入选项[1 \ \ 2 \ \ 3 \ \ 4 \ \ 5 \ \ 6]:\ n ");做{c = getchar();}while(c!='1'&&c!='2'&&c!='3'&&c!='4'&&c!='5'&&!='6');getchar();开关(c){事例“1”:输入();打破;案例“2”:del();打破;事例“3”:find();打破;case“4”:arrange();打破;事例“5”:right();打破;案例“6”:出口(0);}Printf("按任意键返回主菜单:\ n ");getchar();clr SCR();} while(1);}#include <stdio.h >定义图书结构*/结构书{int _ id#include <stdlib.h >#include <string.h >#定义借入1#定义NOBORROW 0/*//数字,唯一char _ name[32];//书的名称,不唯一int _ type//书的类型,不唯一int _ status//书的状态,借出/未借出int _ count//图书借出的次数struct Book * _ next//下一本书结构书* _ prev//前一本书};定义书籍类型*/操作目录提示*/操作目录提示1 */添加图书类型并显示用户信息*/添加图书状态并显示用户信息。

MFC图书管理系统_头文件

MFC图书管理系统_头文件

BookMDlg.h#pragma once#include "CBookDataSet.h"#include "atltime.h"#include "afxdtctl.h"// CBookMDlg dialogclass CBookMDlg : public CDialogEx{DECLARE_DYNAMIC(CBookMDlg)public:CBookMDlg(CWnd* pParent = NULL); // standard constructorvirtual ~CBookMDlg();// Dialog Dataenum { IDD = IDD_BOOK_MAINTAIN };protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportDECLARE_MESSAGE_MAP()private:CString m_strBookNameQ;CString m_strBookIdQ;CString m_strBookName;CString m_strBookId;CString m_strBookPress;CString m_strBookAuthor;CString m_strCanBorrow;CBookDataSet bookDataSet;public:void DisplayRecord(void);void SetButtonState(void);afx_msg void OnBnClickedBtnSearch();afx_msg void OnBnClickedBtnReturn();afx_msg void OnBnClickedBtnFirst();afx_msg void OnBnClickedBtnPrev();afx_msg void OnBnClickedBtnLast();afx_msg void OnBnClickedBtnNext();afx_msg void OnBnClickedBtnAdd();afx_msg void OnBnClickedBtnEdit();afx_msg void OnBnClickedBtnSave();afx_msg void OnBnClickedBtnCancel();afx_msg void OnBnClickedBtnDelete();virtual BOOL OnInitDialog();private:bool m_bAdd;bool m_bEdit;CTime m_tPressDate;CRect m_rect;CWnd* m_pParent;public:CDateTimeCtrl PressDateCtrl;afx_msg void OnSize(UINT nType, int cx, int cy);afx_msg void OnDestroy();afx_msg void OnBnClickedCancel();};CBookDataSet.h// CBookDataSet.h : Declaration of the CBookDataSet#pragma once// code generated on 2010年5月17日, 19:44class CBookDataSet : public CRecordset{public:CBookDataSet(CDatabase* pDatabase = NULL);DECLARE_DYNAMIC(CBookDataSet)// Field/Param Data// The string types below (if present) reflect the actual data type of the// database field - CStringA for ANSI datatypes and CStringW for Unicode // datatypes. This is to prevent the ODBC driver from performing potentially // unnecessary conversions. If you wish, you may change these members to // CString types and the ODBC driver will perform all necessary conversions. // (Note: You must use an ODBC driver version that is version 3.5 or greater // to support both Unicode and these conversions).CStringW m_BOOK_ID;CStringW m_BOOK_NAME;CStringW m_AUTHOR;CStringW m_PRESS;CTime m_PRESS_DATE;CStringW m_FLAG_BORROW;// Wizard generated virtual function overridespublic:virtual CString GetDefaultConnect(); // Default connection stringvirtual CString GetDefaultSQL(); // default SQL for Recordsetvirtual void DoFieldExchange(CFieldExchange* pFX); // RFX support// Implementation#ifdef _DEBUGvirtual void AssertValid() const;virtual void Dump(CDumpContext& dc) const;#endif};CBorrowDataSet.h// CBorrowDataSet.h : Declaration of the CBorrowDataSet#pragma once// code generated on 2010年5月18日, 9:15class CBorrowDataSet : public CRecordset{public:CBorrowDataSet(CDatabase* pDatabase = NULL);DECLARE_DYNAMIC(CBorrowDataSet)// Field/Param Data// The string types below (if present) reflect the actual data type of the// database field - CStringA for ANSI datatypes and CStringW for Unicode// datatypes. This is to prevent the ODBC driver from performing potentially// unnecessary conversions. If you wish, you may change these members to // CString types and the ODBC driver will perform all necessary conversions. // (Note: You must use an ODBC driver version that is version 3.5 or greater// to support both Unicode and these conversions).CStringW m_READER_ID;CStringW m_BOOK_ID;CTime m_BORROW_DATE;CStringW m_B_CLERK_ID;long m_ID;CStringW m_BOOK_NAME;// Wizard generated virtual function overridespublic:virtual CString GetDefaultConnect(); // Default connection stringvirtual CString GetDefaultSQL(); // default SQL for Recordsetvirtual void DoFieldExchange(CFieldExchange* pFX); // RFX support// Implementation#ifdef _DEBUGvirtual void AssertValid() const;virtual void Dump(CDumpContext& dc) const;#endif};CClerkDataSet.h// CClerkDataSet.h : Declaration of the CClerkDataSet#pragma once// code generated on 2010年5月9日, 21:56class CClerkDataSet : public CRecordset{public:CClerkDataSet(CDatabase* pDatabase = NULL);DECLARE_DYNAMIC(CClerkDataSet)// Field/Param Data// The string types below (if present) reflect the actual data type of the// database field - CStringA for ANSI datatypes and CStringW for Unicode// datatypes. This is to prevent the ODBC driver from performing potentially// unnecessary conversions. If you wish, you may change these members to // CString types and the ODBC driver will perform all necessary conversions. // (Note: You must use an ODBC driver version that is version 3.5 or greater// to support both Unicode and these conversions).CStringW m_CLERK_ID;CStringW m_NAME;CStringW m_ID_CARD;CStringW m_PASSWORD;CStringW m_OFFICIER;// Wizard generated virtual function overridespublic:virtual CString GetDefaultConnect(); // Default connection stringvirtual CString GetDefaultSQL(); // default SQL for Recordsetvirtual void DoFieldExchange(CFieldExchange* pFX); // RFX support// Implementation#ifdef _DEBUGvirtual void AssertValid() const;virtual void Dump(CDumpContext& dc) const;#endif};CHistoryDataSet.h// CHistoryDataSet.h : Declaration of the CHistoryDataSet#pragma once// code generated on 2010年5月20日, 22:55class CHistoryDataSet : public CRecordset{public:CHistoryDataSet(CDatabase* pDatabase = NULL);DECLARE_DYNAMIC(CHistoryDataSet)// Field/Param Data// The string types below (if present) reflect the actual data type of the// database field - CStringA for ANSI datatypes and CStringW for Unicode// datatypes. This is to prevent the ODBC driver from performing potentially// unnecessary conversions. If you wish, you may change these members to // CString types and the ODBC driver will perform all necessary conversions. // (Note: You must use an ODBC driver version that is version 3.5 or greater// to support both Unicode and these conversions).CStringW m_READER_ID;CStringW m_BOOK_ID;CTime m_BORROW_DATE;CTime m_RETURN_DATE;CStringW m_B_CLERK_ID;CStringW m_R_CLERK_ID;long m_ID;CStringW m_BOOK_NAME;float m_FineAmount;// Overrides// Wizard generated virtual function overridespublic:virtual CString GetDefaultConnect(); // Default connection stringvirtual CString GetDefaultSQL(); // default SQL for Recordsetvirtual void DoFieldExchange(CFieldExchange* pFX); // RFX support// Implementation#ifdef _DEBUGvirtual void AssertValid() const;virtual void Dump(CDumpContext& dc) const;#endif};FineDlg.h#pragma once// CFineDlg dialogclass CFineDlg : public CDialogEx{DECLARE_DYNAMIC(CFineDlg)public:CFineDlg(CWnd* pParent = NULL); // standard constructorvirtual ~CFineDlg();// Dialog Dataenum { IDD = IDD_FINE };protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportDECLARE_MESSAGE_MAP()public:CString m_strReaderId;float m_fFineAmount;};HistoryDlg.h#pragma once#include "afxcmn.h"// CHistoryDlg dialogclass CHistoryDlg : public CDialogEx{DECLARE_DYNAMIC(CHistoryDlg)public:CHistoryDlg(CWnd* pParent = NULL); // standard constructorvirtual ~CHistoryDlg();// Dialog Dataenum { IDD = IDD_HISTORY };protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportDECLARE_MESSAGE_MAP()private:CString m_strReaderId;public:afx_msg void OnBnClickedSearchByReaderid();afx_msg void OnBnClickedShowAll();private:CListCtrl m_listCtlHistory;public:void ShowList(void);private:bool m_isShowAll;CRect m_rect;public:virtual BOOL OnInitDialog();afx_msg void OnDestroy();afx_msg void OnBnClickedCancel();CWnd *m_pParent;afx_msg void OnSize(UINT nType, int cx, int cy);};LendOutDlg.h#pragma once// CLendOutDlg dialog#include "CBookDataSet.h"#include "CBorrowDataSet.h"#include "ReaderDataSet.h"class CLendOutDlg : public CDialogEx{DECLARE_DYNAMIC(CLendOutDlg)public:CLendOutDlg(CWnd* pParent = NULL); // standard constructorvirtual ~CLendOutDlg();// Dialog Dataenum { IDD = IDD_LEND_OUT };protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportDECLARE_MESSAGE_MAP()private:CString m_strReaderId;CString m_strBookId;CBookDataSet m_bookDataSet;CBorrowDataSet m_borrowDataSet;CReaderDataSet m_readerDataSet;CWnd* m_pParent;CRect m_rect;public:afx_msg void OnBnClickedBtnBorrow();void SetBorrowFlag(void);virtual BOOL OnInitDialog();afx_msg void OnDestroy();afx_msg void OnSize(UINT nType, int cx, int cy);afx_msg void OnBnClickedCancel();};#pragma once#include "atltypes.h"// CLoginDlg dialogclass CLoginDlg : public CDialogEx{DECLARE_DYNAMIC(CLoginDlg)public:CLoginDlg(CWnd* pParent = NULL); // standard constructorvirtual ~CLoginDlg();public:CString m_strName;CString m_strPWD;CString m_strUSERID;BOOL m_bSuccess;// Dialog Dataenum { IDD = 310 };protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportDECLARE_MESSAGE_MAP()public:afx_msg void OnBnClickedBtnLogin();virtual BOOL OnInitDialog();CWnd *m_pParent;afx_msg void OnBnClickedCancel();afx_msg void OnDestroy();afx_msg void OnSize(UINT nType, int cx, int cy);private:CRect m_rect;};LoginDlg.h#pragma once#include "atltypes.h"// CLoginDlg dialogclass CLoginDlg : public CDialogEx{DECLARE_DYNAMIC(CLoginDlg)public:CLoginDlg(CWnd* pParent = NULL); // standard constructorvirtual ~CLoginDlg();public:CString m_strName;CString m_strPWD;CString m_strUSERID;BOOL m_bSuccess;// Dialog Dataenum { IDD = 310 };protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportDECLARE_MESSAGE_MAP()public:afx_msg void OnBnClickedBtnLogin();virtual BOOL OnInitDialog();CWnd *m_pParent;afx_msg void OnBnClickedCancel();afx_msg void OnDestroy();afx_msg void OnSize(UINT nType, int cx, int cy);private:CRect m_rect;};MainFrm.h// 这段MFC 示例源代码演示如何使用MFC Microsoft Office Fluent 用户界面// (“Fluent UI”)。

c语言最全的图书管理系统程序

c语言最全的图书管理系统程序

题目名称:图书管理系统算法分析:1用结构体标出信息系统的成员:图书书号,书名,作者姓名,出版社,价格2 利用c语言的文件知识将系统的信息存放在c盘下的“project choose.txt”的文件夹下3 定义各个子函数(1)定义输入信息函数,将图书信息按一定格式用scanf函数输入(统计M本的信息);(2)定义输出函数,每3个表一页直到最后一个;(3)定义信息查询函数。

a,定义按书号查询函数,如果输入的数字等于图书编号则输出要查询的信息;b,定义按姓名查询函数,如果输入的姓名字符串等于其中一个作者姓名字符串则输出信息;c,定义按出版社名称查找函数,如果输入的字符串等于其中出版社名称,则输出该信息; e,定义查找总函数,输入一个数选择查找方式,1-4分别对应调用abc四个函数。

(4)定义删除信息函数。

输入的数字作为要删除的图书编号,输出要删除的图书信息后选择是否删除,删除后将第g+1个的信息赋给第g个,输出删除后的信息表。

(5)定义信息修改函数。

输入的数字等于要修改的图书编号,输出要修改的图书信息后选择是否修改,用switch,case语句选择要修改的项目,输入n,y决定是否继续直到不继续修改,输出图书信息。

(6)定义信息统计函数。

输入一个字符串作为出版社,比较M 本书的出版社字符串是否等于输入的字符串,统计相等的个数n输出。

(7)定义图书编号排序函数。

用冒泡排序法将M本的书的图书编号按从大到小的顺序排列后输出。

4 定义主函数。

调用读取文件函数,输入数字1-5分别对应调用修改图书信息函数,删除图书信息函数,查找图书信息函数,统计图书信息函数,图书排行信息函数,0表示退出系统。

最后调用保存文件函数。

结束程序。

流程设计:代码设计:#include<stdio.h>#include<stdlib.h>#include<string.h>#define M 2#define PAGE 3/*图书结构体类型*/typedef struct{int num; /*图书号*/char name[20]; /*书名*/char zuozhe[20]; /*作者姓名*/char chubanshe[20]; /*出版社*/int price; /*价格*/}BOOKS;int read_file(BOOKS books[]){ FILE *fp;int i=0;if((fp=fopen("project choose.txt","rt"))==NULL){ printf("\n\n*****库存文件不存在!请创建");return 0;}while(feof(fp)!=1){ fread(&books[i],sizeof(BOOKS),1,fp);if(books[i].num==0)break;elsei++;}fclose(fp);return i;}void save_file(BOOKS books[],int sum){ FILE *fp;int i;if((fp=fopen("project choose.txt","wb"))==NULL){ printf("读文件错误!\n");return;}for(i=0;i<sum;i++)if(fwrite(&books[i],sizeof(BOOKS),1,fp)!=1)printf("写文件错误!\n");fclose(fp);}/*输入模块*/int input(BOOKS books[]){ int i=0;printf("\n\n 录入图书信息(最多%d 种)\n",M);printf("----------------------------------------------------\n");do{ printf("\n 第%d本图书",i+1);printf("\n 图书编号:");scanf("%d",&books[i].num); if(books[i].num==0) break;printf("\n 图书名称:");scanf("%s",books[i].name);printf("\n 作者:");scanf("%s",books[i].zuozhe);printf("\n 出版社:");scanf("%s",&books[i].chubanshe);printf("\n 图书价格:");scanf("%d",&books[i].price);i++;}while(i<M);printf("\n --%d种图书信息输入完毕!--\n",i);printf("\n 按任意键返回主菜单!");getchar();return i;}/*输出模块*/void output(BOOKS books[]){int i=0,j=0,page=1;printf("\n\n --图书信息表-- 第%d页\n\n",page);printf("图书编号----图书名称-----作者----- 出版社-----图书价格\n");printf("-------------------------------------------------------\n");do{ if(books[i].num!=0){ j++;if(j%PAGE!=0){ printf("%4d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);printf("------------------------------------------------------\n");}else{ printf("按任意键继续!");getchar();printf("\n\n --图书信息表-- 第%d页\n\n",++page);printf("图书编号--图书名称--作者-- 出版社--图书价格\n");printf("------------------------------------------\n");printf("%4d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);printf("---------------------------------------------\n");}}i++;}while(books[i].num!=0);printf("按任意键返回主菜单!");getchar( );}/*给定编号,作者,出版社查找信息模块*/void find_by_num(BOOKS books[],int sum){ int i,find_num;printf("\n 请输入要查找的图书编号:");scanf("%d",&find_num);for(i=0;i<sum;i++)if(books[i].num==find_num){printf("这是您所查找到的图书:\n");printf("图书编号----图书名称----作者---- 出版社---图书价格\n");printf("------------------------------------------\n");printf("%4d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe,books[i].chubanshe,books[i].price);printf("---------------------------------------------\n");break;}else{printf("\n 未找到要查找的图书信息,按任意键返回!");getchar();}}void find_by_zuozhe(BOOKS books[],int sum){int i;char find_zuozhe[20];printf("\n 请输入要查找的作者姓名:");scanf("%s",find_zuozhe);for(i=0;i<sum-1;i++)if(strcmp(books[i].zuozhe,find_zuozhe)==0){printf("这是您所查找到属于该作者的图书:");printf("图书编号--图书名称--作者-- 出版社--图书价格\n");printf("------------------------------------------\n");printf("%8d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);printf("---------------------------------------------\n");}else{printf("\n 未找到要查找的图书信息,按任意键返回!");}}void find_by_chubanshe(BOOKS books[],int sum){int i;char find_chubanshe[20];printf("\n 请输入要查找的出版社名称:");scanf("%s",find_chubanshe);for(i=0;i<sum;i++)if(strcmp(books[i].chubanshe,find_chubanshe)==0){printf("这是您所查找到属于该出版社的图书:");printf("图书编号--图书名称--作者-- 出版社--图书价格\n");printf("------------------------------------------\n");printf("%8d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);printf("---------------------------------------------\n");}else{printf("\n 未找到要查找的图书信息,按任意键返回!");getchar();}}void find(BOOKS books[],int sum){ int choice;printf("\n 您要按照哪种方式查找? \n");printf("\n 1.按图书编号查找\n");printf("\n 2.按图书作者查找\n");printf("\n 3.按出版社查找\n");printf("\n 0. 退出\n");printf("\n 请选择(0-3): \n");scanf("%d",&choice);switch(choice){ case 1: find_by_num(books,sum); break;case 2: find_by_zuozhe(books,sum); break;case 3: find_by_chubanshe(books,sum); break;case 0: break;}}/*删除信息模块*/void del(BOOKS books[]){ int i,sum;int del_num;printf("\n 请输入要删除的图书编号:");scanf("%d",&del_num);for(i=0;i<sum;i++)if(books[i].num==del_num){printf("这是您所要删除图书信息:\n");printf("图书编号----图书名称----作者---- 出版社----图书价格\n");printf("----------------------------------------------------\n");printf("%8d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);printf("-----------------------------------------------------\n");printf("您确认要删除吗?");printf("按任意键继续!");getchar();printf("已成功删除图书信息!");}}/*信息修改模块*/void modify(BOOKS books[],int sum){int i=0,choice,modify_num,flag;do{printf("请输入要修改的图书编号:");scanf("%d",&modify_num);for(i=0;i<sum;i++)if(books[i].num==modify_num){ printf("\n\n --图书信息-- \n\n");printf("图书编号----图书名称----作者---- 出版社----图书价格\n");printf("------------------------------------------\n");printf("%8d %10s %10s %10s %8d \n",books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);printf("---------------------------------------------\n");printf("\n 您要修改哪一项?\n");printf("\n 1.图书名称\n");printf("\n 2.作者\n");printf("\n 3.出版社\n");printf("\n 4.图书价格\n");printf("\n 请选择(1-4):\n");scanf("%d",&choice);switch(choice){ case 1: printf("\n 请输入修改后的图书名称:");scanf("%s",books[i].name); break;case 2: printf("\n 请输入修改后的作者姓名:");scanf("%s",books[i].zuozhe); break;case 3: printf("\n 请输入修改后的出版社名称:");scanf("%s",books[i].chubanshe); break;case 4: printf("\n 请输入修改后的图书价格:");scanf("%d",&books[i].price); break;}printf("\n\n --图书信息-- \n\n");printf("图书编号----图书名称----作者---- 出版社----图书价格\n"); printf("--------------------------------------------\n");printf("%8d %10s %10s %10s %8d \n",books[i].num,books[i].name, books[i].zuozhe, books[i].chubanshe,books[i].price); printf("---------------------------------------------\n");break;}else{printf("\n 该书不存在!");getchar();}printf("\n 修改成功!\n");printf("您要继续修改吗?(Y/N)");if (choice=='Y'||choice=='y'){ flag=1;printf("\n 继续!\n");}else flag=0;}while( flag==1);printf("\n 按任意键返回主菜单!");getchar();}/*图书信息统计模块*/void count(BOOKS books[],int sum) /*统计某个出版社的图书数*/ { int i;char count_chubanshe[20];int n=0;printf("请输入一个出版社名称:\n");scanf("%s",count_chubanshe);for(i=0;i<sum;i++){if( strcmp(books[i].chubanshe,count_chubanshe)==0)n++;break;}printf("统计出属于该出版社一共有%d本书\n",n);}/*排序模块*/void sort(BOOKS books[],int sum) /*按图书编号排序模块*/{BOOKS t;int i,j;printf("\n --图书信息-- \n");printf("\n 排名图书编号图书名称作者出版社图书价格\n");for(i=1;i<sum-1;i++)for(j=i+1;j<sum;j++)if(books[j].num>books[i].num){t=books[j];books[j]=books[i];books[i]=t;}for(i=0;i<sum;i++){ printf("%2d %8d %12s %12s %12s %6d \n",i+1,books[i].num,books[i].name,books[i].zuozhe, books[i].chubanshe,books[i].price);}}void main(){ BOOKS books[M];int choice,sum;sum=read_file(books);if (sum==0){printf("请录入基本图书信息!*******\n");sum=input(books);}do{printf("\n\n\n *******图书馆理系统******* \n\n");printf(" 1.修改图书信息\n\n");printf(" 2.删除图书信息\n\n");printf(" 3.查找图书信息\n\n");printf(" 4.统计图书信息\n\n");printf(" 5.图书排行信息\n\n");printf(" 0.退出系统\n\n");printf(" 请选择\n\n");scanf("%d",&choice);switch(choice){ case 1 : modify(books,sum); break;case 2 : del(books); break;case 3 : find(books,sum); break;case 4 : count(books,sum); break;case 5 : sort(books,sum); break;case 0 : break;}}while(choice!=0);save_file(books,sum);}运行结果:。

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

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

程序设计实践信息类 1110开辟一个图书信息管理系统,图书信息包括:图书编号、书名、作者、出版社、类别、出版时间、价格等基本信息(也可以根据自己情况进行扩充,比如是否借出、库存量等)(1)图书信息录入功能(图书信息用文件保存)--输入(2)图书信息浏览功能--输出(3)查询功能(至少一种查询方式)、排序功能(至少一种排序方式):①按书名查询②按作者名查询③ 按照价钱排序④按出版时间排序等等(4)图书信息的删除与修改(1)简单的权限处理 (2)报表打印功能(3)甚至根据自己情况,可以加之学生信息,并扩充为图书借阅系统。

(4) 含糊查询 (5)综合查询 (6)统计功能比如统计处某一类别的图书信息或者筛选出小于指定数量库存的图书信息等等,总之,可以根据自己需求进行分析功能。

一、提交材料应包括: (1)系统源代码 (2)课程报告二、整个设计过程具体要求(1要求学生对案例系统进行分析,设计出需要完成的功能,完善各个模块的调用关系;(2要求学生进一步明确各模块调用关系,进一步完善模块函数细节(函数名、参数、返回值等)(3要求学生养成良好的编码习惯、完成各个模块并进行测试,最终完成系统整体测试;(4按照要求完成系统设计和实现报告,并进行总结、答辩。

1 需求分析这是一个能简单管理图书的小型图书管理系统,其中图书信息包括:书名,作者名,书编号,分类,出版单位,出版时间,价格等。

通过这些信息使之提供以下功能:(1)图书信息创建功能。

其中图书信息包括:书名,作者名,书编号,分类,出版单位,出版时间,价格等。

(图书信息用文件保存)。

(2)图书信息查看功能。

用来查看各项图书信息。

(3)图书信息查找功能。

通过已知信息来查找想要的图书。

(4)图书信息的删除。

可以删除特定图书。

(5)图书信息的修改。

可以修改图书的各项信息。

(6)图书信息的排序功能。

按图书信息对录入的图书进行排序。

(7)菜单选择功能,此功能也是图书信息信息管理系统的入口,用户所要进行的各种操作均需在此模块中进行选择并进而调用其他模块实现相应的功能2 概要设计图书管理系统中主要的数据结构包含书名、图书书号、作者名、分类、出版社、出版时间、价格等;在处理过程中各项可以作为一本图书的不同属性来进行处理。

图书馆管理系统C语言程序设计

图书馆管理系统C语言程序设计

HUNAN UNIVERSITY C语言程序训练报告【设计目的】图书信息包括:读者登录号、管理员登录号、图书编号、作者名、种类、出版社、图书库存、图书借出数目等。

图书信息管理系统,使之能提供以下功能:1)系统以菜单方式工作2)读者注册功能3)读者登录功能4)读者借书还书功能5)查询读者借阅记录6)查询在管图书信息功能7)修改密码功能8)管理员登录功能9)增加、修改、删除图书功能10)查看图书信息功能【设计思路】根据题目要求,应当把图书信息用结构体形式输入,应该提供以下结构体和文件的输入等操作:在程序中需要实现图书信息录入,浏览,查询,删除和修改等功能的操作,所以需要建立相应的模块来实现:另外还需提供选择菜单实现功能,在运行时达到所要求的目的;管理员和读者登录界面及各自功能应有不同的实现。

【总体设计】【详细设计】1.主函数主函数设计要求简洁,只提供部分提示语和函数的调用源代码为//rkou。

c 程序的入口#include<stdio。

h>#include〈stdlib.h〉#include〈string。

h>#include<conio.h〉#include"head.h”#include”fuc.h"#include”picture。

h"#include”jiangzhuo1.h"#include”output。

h"main(){ int i=setup();switch (i){ case 0: while(n<50){ conects(n);}default:eros(i);}system("pause”);}2.程序中全局变量声明定义,以及所有函数声明源代码为struct book //图书结构体声明{ char name[50],classic[10],writer[20]; //书名,类别,作者int jn; //借出数量int zn; //在馆数量int bh; //图书编号};struct information //管理员和读者结构体声明{char name[10],no[12],key[10]; //姓名,账号,密码};struct show //图书借阅记录的结构体声明{char name1[10],name2[50],writer[20],no[12]; //书名,读者姓名,书的作者,读者账号int bh,o; //图书编号,借阅状况(未还,已还)};//以下为用到的全局变量struct book bk;struct information aa,rr;struct information stu[100];struct book bb[100];struct information ad[100];struct show ss[100];int i,j,k,s;int n=0;int x;FILE *fp;//以下函数主要功能:方便窗口与用户之间交换信息int regst();void password(char *a,int b,int j);//登陆时的输入函数void examine(int *a,int b); //保证键入的数据是数字void changepaw(int a,int b); //修改密码用到的提示函数void inputs0(); //输出图书类别以供用户选择void inputs1(int a,int b,int c,int d,int e); //方便用户输入图书各项信息(如书名,编号)void inputs2(int a,int b,int c); //方便用户输入管理员的信息(如账号姓名)void inputs3(int a,int b,int c);//方便用户输入读者的信息(如账号姓名)void eros(int i); //错误显示函数,操作一旦出错,则会出现相应的错误信息void conects(int j); //连接函数,选择界面//一下函数主要用于改变文件的内容并保存int setup(); //数据初始化函数int xzc(char no[12],char key1[10],char key2[10],char name[10]);//读者注册函数int exam(char no[10],char key[10],int n);//密码账号检验函数int mp(char no[12],char key1[10],char key2[10],char key3[10],int n); //密码修改函数void paixu(); //对图书按照编号从小到大的顺序进行排列int sc(int bh); //管理员删除图书信息函数int zj(struct book bb); //管理员增加图书信息函数int xg(struct book bb);//管理员修改图书信息函数int js(int bh,char no[12]); //借书函数int hs(int bh,char no[12]); //还书函数int bh1(int bh); //判断该编号的图书信息是否存在函数void bh2(int bh); //按照图书编号显示图书信息函数int sm1(char name[50]);//判断是否存在该名字的图书信息函数void sm2(char name[50]); //按照图书名字显示图书信息函数int zz1(char writer[20]); //判断是否存在该作者的图书信息函数void zz2(char writer[20]);//按照图书作者显示图书信息函数void lb(char classic[10]); //按类别显示图书信息int rck1(int bh);//判断该编号的图书的借书记录是否存在void rck2(int bh);//按编号显示图书借书情况int gck21(char no[12]);//判断该账号读者的借书记录是否存在void gck22(char no[12]); //按读者显示借书情况2void gck12(); //显示全部借书情况void gck23();//管理员查看所有书的信息void copy(int bh); // 按编图书编号将图书信息暂时保存在另外一个结构体里面void copy2(char no[12]); //按管理员账号将管理员信息暂时保存在另外一个结构体里面void copy3(char no[12]);//按读者账号将读者信息暂时保存在另外一个结构体里面//pic()函数:每个函数表示一个界面,conects函数将它们连接起来void pic0();void pic1();void pic2();void pic3();void pic4();void pic5();void pic6();void pic7();void pic8();void pic9();void pic10();void pic11();void pic12();void pic13();void pic14();void pic15();void pic16();void pic17();void pic18();void pic19();void pic20();void pic21();void pic22();void pic23();void pic24();void pic25();void pic26();void pic27();void pic29();void pic30();void pic31();void pic32();void pic33();void pic34();void pic35();void pic36();void pic37();void pic38();void pic39();void pic40();void pic41();void pic42();void pic43();void pic44();void pic45();void pic46();void pic47();void picc();3.用户输入以及界面反馈用到的功能函数源代码为int regst(){char num[12],paw1[10],paw2[10],name[10];int i;printf(”请输入账号\n(11字符以内,不能含有中文字符):\n”);password(num,0,11);printf(”输入您的密码\n(9字符以内,不能含有中文字符):\n");password(paw1,1,9);printf("请再次输入密码:\n”);password(paw2,1,9);printf("输入您的姓名:\n");gets(name);system("cls”);i=xzc(num,paw1,paw2,name);return i;}void password(char *a,int b,int j){ char c;int i=0;while((c=getch())!=’\r’){if(c==8){ printf(”\b \b”);if(i〉0)i-—;}else if(i<j){if(b)printf("*”);else printf("%c",c);a[i]=c;i++;}if(i==j){ printf("\a");}}a[i]='\0';printf("\n");}void examine(int *a,int b){ while(!scanf(”%d",a)){ while(getchar()!='\n’);printf("请输入数字!!\n");}rewind(stdin);if(b) system("cls”);}void changepaw(int a,int b){ int i;char c1[10],c2[10],c3[10];printf("请输入原密码\n”);password(c1,1,9);printf("请输入新密码\n");password(c2,1,9);printf(”请再次输入新密码\n”);password(c3,1,9);system("cls”);if(b){i=mp(aa。

图书借阅管理系统

图书借阅管理系统

for(int i=0;i<Maxbor;i++) if(borbook[i]!=0) cout << borbook[i] << "|"; cout << "]"<<endl; } };
//读者类库,实现建立读者的个人资料 class RDatabase {
private: int top; //读者记录指针 Reader read[Maxr];//读者记录
七、参考文献:
1.MS-DOS 命令大全[帮助文件]/落雪飞花;网络资料 2.C++函数库参考[帮助文件];刘双印老师提供 3.C++基础教程--从问题分析到程序设计[专著](美)D. S. Malik 著;清华大学出版 社
八、附录图书借阅管理系统C++代码源程序
#include <iostream> #include <iomanip> #include <string> #include <fstream>//输入/输出文件流类 using namespace std; const int Maxr=100;//最多的读者 const int Maxb=100;//最多的图书 const int Maxbor=5;//每位读者最多借五本书
Book books[100];
//定义 Book 书籍结构体数组对象,最大容量 100 本
int length;
// 计数
void saveFile()
// 保存书籍文件
void readFile()
// 读取书籍文件
②公有数据及函数
BookManage()

数据库设计关于图书馆管理系统的设计(有完整代码,史上最全!)

数据库设计关于图书馆管理系统的设计(有完整代码,史上最全!)

数据库设计关于图书馆管理系统的设计(有完整代码,史上最全!)《数据库》课程设计(2008/2009学年第2学期第18-19 周)数据库课程设计任务书⼀、⽬的1.掌握计算机管理信息系统设计的⼀般⽅法,主要包括系统分析、系统设计的组织和实施。

2.关系型数据库管理系统的编程技术,并能独⽴完成⼀般⼩系统的程序设计、调试运⾏等⼯作。

3.培养把所学知识运⽤到具体对象,并能求出解决⽅案的能⼒。

⼆、任务(任选其⼀)A.运⽤关系型数据库管理系统,实现本院图书馆管理信息系统。

具体要求如下:—图书、资料的登记、注销和查询。

—借书证管理,包括申请、注销借书证,查询借书证持有⼈等。

—借还图书、资料的登记、超期处理,超期拒借等。

—图书、资料查询,借、还图书和资料情况查询。

—图书、资料借阅情况的统计分析,拒此作为图书馆图书、资料订够的依据之⼀。

(本项不作为基本要求)B.运⽤关系型数据库管理系统,实现服务电话管理系统向客户现场派技术⼈员的服务公司可以⽤服务电话管理系统跟踪客户、员⼯、⼯作订单、发票、付款等等。

要求:数据库要存储以下信息:—客户信息—客户⼯需单信息—完成⼯需单所需⼈⼯—完成⼯需单所需部件—部件信息—付款信息—雇员信息完成的功能:—输⼊/查看客户⼯需单信息—输⼊/查看部件、雇员等其它信息—付款—打印发票等三、结果形式1.设计报告:含E-R图、数据字典、关系模式、关系实例、查询描述、关系代数、SQL 实现的查询语⾔及查询结果。

2.上机实现。

四、考核1.课程设计态度(20分)。

2.递交的书⾯材料(40分)。

3.上机运⾏情况(40分)⽬录1.问题描述 (2)1.1背景 (2)1.2数据需求 (2)1.3事物需求 (3)1.4关系模式 (3)2.⽅案图表设计 (3)2.1E-R图 (3)2.2数据流程图 (8)2.3数据字典 (9)2.4关系图: (11)3.数据库源代码 (12)3.1数据库建⽴ (12)3.2数据初始化 (14)4.结果数据处理 (17)4.1单表查询 (17)4.2超期处理 (19)4.3还书操作 (20)4.4借书操作 (22)4.5书籍状态 (24)4.6读者状态 (24)5.结束语 (26)5.1课程设计⼼得 (26)1.问题描述1.1背景随着图书馆规模的不断扩⼤,图书数量也相应的增加,有关图书的各种信息量也成倍增加,⾯对着庞⼤的信息量,传统的⼈⼯⽅式管理会导致图书馆管理上的混乱,⼈⼒与物⼒过多浪费,图书馆管理费⽤的增加,从⽽使图书馆的负担过重,影响整个图书馆的运作和控制管理,因此,必须制定⼀套合理、有效,规范和实⽤的图书管理系统,对图书资料进⾏集中统⼀的管理。

c语言学籍管理系统源代码

c语言学籍管理系统源代码

C语言学籍管理系统源代码简介本文档介绍了一个用C语言编写的学籍管理系统的源代码。

学籍管理系统是一个用于管理学生的基本信息和学习成绩的软件系统。

该系统可以帮助学校、学院和教师有效地管理学生的信息,并生成学生的成绩报表。

功能学籍管理系统具有以下功能:1.添加学生:可以添加学生的基本信息,如学号、姓名、性别、班级等。

2.删除学生:可以根据学号删除已有的学生信息。

3.查询学生:可以根据学号查询学生的信息。

4.修改学生:可以根据学号修改学生的信息。

5.成绩录入:可以录入学生的学习成绩,包括各科目的成绩和总分。

6.成绩查询:可以根据学号查询学生的成绩。

7.成绩统计:可以统计学生各科目的平均分、最高分和最低分。

程序结构学籍管理系统的源代码主要包括以下几个文件:1.main.c:程序的入口文件,包含主函数和界面显示函数。

2.student.h:定义了学生的结构体和相关操作函数。

3.student.c:实现了学生结构体的操作函数,包括添加学生、删除学生、查询学生、修改学生等。

4.score.h:定义了成绩的结构体和相关操作函数。

5.score.c:实现了成绩结构体的操作函数,包括成绩录入、成绩查询、成绩统计等。

使用说明1.下载源代码:将源代码文件下载到本地电脑上。

2.编译程序:打开命令行窗口,进入源代码所在的目录,使用gcc编译器编译源代码文件。

示例命令为:gcc main.c student.c score.c -ostudent_management_system。

3.运行程序:编译成功后,运行生成的可执行文件。

示例命令为:./student_management_system。

4.操作系统:该学籍管理系统适用于Linux、Unix和Windows操作系统。

示例代码以下是学籍管理系统的示例代码:```c #include <stdio.h> #include。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

#include<stdio。

h〉#include<stdlib.h〉#include〈string。

h〉struct tushu{ /*图书结构体*/ char num[10]; /*编号*/char name[20];/*书名*/char writer[20];/*作者*/char press[20];/*出版社*/char kind[20];/*类别*/double time; /*时间*/double price;/*价格*/struct tushu *next;};struct stu /*学生结构体*/ {int snum;/*学号*/char mima[10]; /*密码*/struct stu *next;};FILE *fp; /*图书文件*/FILE *fp1; /*管理员信息文件*/ FILE *fp2; /*学生信息文件*/void menu();/*管理员主菜单(管理员进入对图书及学生信息进行管理操作)*/void xmenu();/*学生主菜单(学生进入可对图书,密码进行操作)*/void gfind(); /*管理员查询(管理员可按一定的方式查询图书)*/void xfind();/*学生查询(学生可按一定的方式查询图书)*/ void secret();/*管理员权限(管理员登陆所用,输入错误次数过多自动退出)*/void sort();/*排序(管理员可按一定的方式对图书进行排序,排序完之后可选择文件进行保存)*/void fprint(struct tushu *head);/*保存(可追加的保存,如添加可用)*/void fprint_(struct tushu *head);/*保存(可覆盖保存如修改,删除,排序后用)*/void hfprint(struct tushu *head); /*还书保存(还书成功后自动保存到文件)*/void jfprint_(struct tushu *head);/*借书保存(借书成功之后自动从图书馆删除)*/struct tushu * Input(); /*图书添加(可进行图书的添加)*/struct tushu *create(); /*从文件创建链表(从文件中读出信息,建立单链表)*/void gBrowse(struct tushu *head);/*管理员浏览(对图书进行遍历)*/void xBrowse(struct tushu *head);/*学生浏览(学生对图书进行遍历)*/void count(struct tushu *head); /*统计数量(管理员可对图书进行统计)*/void Findofname(struct tushu *head); /*按书名查找*/ void Findofwriter(struct tushu *head); /*按作者查找*/void Findofkind(struct tushu *head); /*按类别查找*/void xFindofname(struct tushu *head);/*学生按书名查找*/void xFindofwriter(struct tushu *head);/*学生按作者查找*/ void xFindofkind(struct tushu *head); /*学生按类别查找*/ void Sort_time(struct tushu * head); /*按时间排序(管理员按时间对图书进行排序,排序完之后可选择文件进行保存)*/ void Sort_price(struct tushu *head); /*按价格排序*/void Sort_num(struct tushu * head);/*按编号排序*/ void Delete(struct tushu * head,char m[15]);/*按编号删除(管理员可按编号删除图书)*/void Revise(struct tushu *head);/*修改(管理员可对图书进行修改,并选择是否保存)*/void borrow(struct tushu *head); /*借书*/void huanshu(); /*还书(学生借完书之后进行还书,若没有图书则不能借)*/void gxinxi(); /*管理员信息(有管理员的账号及密码,可进行修改)*/void xmima(struct stu *head1);/*学生密码修改(学生可对自己的密码进行修改)*/struct stu *xcreate();/*从文件创建学生信息(从文件读出学生信息,建立学生链表)*/void xsecret(struct stu *head1);/*学生权限(学生登陆所用)*/void menu() /*管理员主菜单(管理员进入对图书及学生信息进行管理操作)*/{int choice,n=0;struct tushu *head;struct stu *head1,*p;char m[15];there:printf("┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n"); printf(" ┃┃socat 图书管理系统printf(” ┃┗━━━━━━━━━━━━━━━━━━━┛┃\n"); printf(" ┃●[0]退出系统┃\n");printf(” ┃┃\n”);prin tf(” ┃●[1]帮助┃\n");printf(” ┃┃\n”);printf(” ┃●[2]浏览图书┃\n");printf(” ┃┃\n");printf(” ┃●[3]统计图书数目┃\n”);printf(" ┃┃\n”);printf(” ┃●[4]查询┃\n”);printf(” ┃printf(” ┃●[5]添加┃\n");printf(” ┃┃\n”);printf(” ┃●[6]排序┃\n");printf(” ┃┃\n");printf(" ┃●[7]修改┃\n”);printf(” ┃┃\n");printf(" ┃●[8]删除┃\n”);printf(" ┃┃\n”);printf(" ┃●[9]修改账号及密码┃\n");printf(” ┃┃\n”);printf(” ┃●[10]学生信息printf(”┗━━━━━━━━━━━━━━━━━━━━━━━┛\n");printf(” 请选择:”);fflush(stdin);head=create();scanf("%d”,&choice);if(choice==1){//help();printf(”没有内容!\n”);system("pause”);system(”cls”);menu();}else if(choice==2){system(”cls");if(head==NULL){printf(”没有图书,请先添加图书!\n”);system("pause");system("cls");menu();}gBrowse(head);}else if(choice==3){system(”cls");count(head);}else if(choice==4){system("cls");if(head==NULL){printf(”没有图书,请先添加图书!\n”);system("pause”);system(”cls”);menu();}gfind();}else if(choice==5){Input();}else if(choice==6){system("cls");if(head==NULL){printf(”没有图书,请先添加图书!\n”); system("pause”);system(”cls”);menu();}sort(head);}else if(choice==7){system("cls”);if(head==NULL){printf(”没有图书,请先添加图书!\n”);system("pause");system("cls”);menu();}Revise(head);}else if(choice==8){if(head==NULL){printf("没有图书,请先添加图书!\n");system(”pause");system(”cls");menu();}printf(" 请输入想要删除的图书编号:”);scanf(”%s",m);Delete(head,m);}else if(choice==9){gxinxi();else if(choice==10){system(”cls”);head1=xcreate();if(head1==NULL){printf("没有学生信息,请到xuesheng_list.txt添加!\n”); sys tem(”pause”);system(”cls”);menu();}for(p=head1;p!=NULL;p=p—>next){printf(”学生学号密码\n”);printf("%d %s\n",p->snum,p—>mima);}system(”pause”);system("cls”);menu();}else if(choice==0)system(”cls");printf(”\n\n\n\n”);printf(” ━━━━━━━━感谢使用图书管理系统━━━━━━━━\n\n\n”);exit(0);}else{system("cls");printf(”\n\n\n\n ━━━━输入错误,请重新输入!━━━━\n\n\n ");system("pause”);system(”cls”);n++;if(n==3){printf(” \n\n\n ━━━━━━━━你错误次数太多,自动退出!━━━━━━━━\n\n\n”);printf(" ━━━━━━━━感谢使用图书管理系统━━━━━━━━\n\n\n");system(”pause");exit(0);}goto there;}}void xmenu()/*学生主菜单(学生进入可对图书,密码进行操作)*/{struct tushu *head;struct stu *head1;int choice,n=0;there:printf(”┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n");printf(” ┃┃socat 图书借阅系统┃┃\n");printf(” ┃┗━━━━━━━━━━━━━━━━━━━┛┃\n"); printf(” ┃●[0]退出系统┃\n”);printf(” ┃printf(” ┃●[1]帮助┃\n”);printf(” ┃┃\n”);printf(” ┃●[2]浏览图书┃\n");printf(” ┃┃\n”);printf(" ┃●[3]查询┃\n”);printf(” ┃┃\n”);printf(” ┃●[4]借书┃\n");printf(” ┃┃\n”);printf(" ┃●[5]还书┃\n");printf(" ┃┃\n”);printf(” ┃●[6]修改密码printf("┗━━━━━━━━━━━━━━━━━━━━━━━┛\n”); printf(" 请选择:");fflush(stdin);head=create();scanf("%d”,&choice);if(choice==1){//xhelp();printf(”没有内容!\n");system(”pa use");system(”cls”);xmenu();}else if(choice==2){system("cls");if(head==NULL){printf(”没有图书!\n");system("pause”);xmenu();}xBrowse(head);}else if(choice==3){if(head==NULL){printf(”没有图书!\n”);system(”pause”);system(”cls”);xmenu();}xfind();}else if(choice==4){if(head==NULL){printf(”没有图书!\n");system(”pause”);xmenu();}borrow(head);}else if(choice==5){huanshu(head);}else if(choice==6){system("cls”);head1=xcreate();if(head1==NULL){printf(”学生信息被清空!!\n”);system("pause");system("cls”);xmenu();}xmima(head1); ;}else if(choice==0){system("cls");printf(”\n\n\n\n”);printf(” ━━━━━━━━感谢使用图书管理系统━━━━━━━━\n\n\n");exit(0);}else{system("cls”);printf("\n\n\n\n ━━━━输入错误,请重新输入!━━━━\n\n\n ”);system(”pause”);system(”cls”);n++;if(n==3){printf(” \n\n\n ━━━━━━━━你错误次数太多,自动退出!━━━━━━━━\n\n\n”);printf(” ━━━━━━━━感谢使用图书管理系统━━━━━━━━\n\n\n”);system("pause”);exit(0);}goto there;}}void gfind()/*管理员查询(管理员可按一定的方式查询图书)*/{int choice,n=0;struct tushu *head;there:system(”cls”);printf(” ┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n”);printf(” ┃┃socat 图书借阅系统┃┃\n”);printf(” ┃┗━━━━━━━━━━━━━━━━━━━┛┃\n");printf(" ┃●[0]返回┃\n");printf(" ┃┃\n”);printf(" ┃●[1]按书名查找┃\n”);printf(" ┃┃\n”);printf(" ┃●[2]按作者查找┃\n”);printf(” ┃┃\n”);printf(" ┃●[3]按类别查找┃\n”);printf(" ┃┃\n”);printf(" ┃● ┃\n”);printf(”┗━━━━━━━━━━━━━━━━━━━━━━━┛\n”);printf(" 请选择:”);fflush(stdin);head=create();scanf(”%d”,&choice);if(choice==1){system(”cls");Findofname(head); }else if(choice==2){system(”cls”); Findofwriter(head); }else if(choice==3){system(”cls");Findofkind(head); }else if(choice==0){system(”cls”);menu();}else{system(”cls”);printf(”\n\n\n\n ━━━━输入错误,请重新输入!━━━━\n\n\n ”);system("pause");system(”cls");n++;if(n==3){printf(" \n\n\n ━━━━━━━━你错误次数太多,自动退出! ━━━━━━━━\n\n\n”);printf(" ━━━━━━━━感谢使用图书管理系统━━━━━━━━\n\n\n”);system(”pause”);exit(0);}goto there;}}void xfind()/*学生查询(学生可按一定的方式查询图书)*/ {struct tushu *head;int choice,n=0;there:system("cls”);printf(” ┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n”);printf(” ┃┃socat 图书借阅系统┃┃\n”);printf(” ┃┗━━━━━━━━━━━━━━━━━━━┛┃\n");printf(” ┃●[0]返回┃\n”);printf(” ┃┃\n");printf(" ┃●[1]按书名查找┃\n”);printf(” ┃┃\n”);printf(" ┃●[2]按作者查找┃\n”);printf(" ┃┃\n");printf(” ┃●[3]按类别查找┃\n");printf(” ┃┃\n”);printf(" ┃● ┃\n");printf(”┗━━━━━━━━━━━━━━━━━━━━━━━┛\n"); printf(” 请选择:");fflush(stdin);head=create();scanf(”%d",&choice);if(choice==1){system(”cls”);xFindofname(head);}else if(choice==2){system(”cls”);xFindofwriter(head);}else if(choice==3){system("cls");xFindofkind(head);}else if(choice==0){system(”cls");xmenu();}else{system("cls");printf("\n\n\n\n ━━━━输入错误,请重新输入!━━━━\n\n\n ”);system(”pause”);system(”cls");n++;if(n==3){printf(” \n\n\n ━━━━━━━━你错误次数太多,自动退出!━━━━━━━━\n\n\n”);printf(” ━━━━━━━━感谢使用图书借阅系统━━━━━━━━\n\n\n”);system("pause”);exit(0);}goto there;}}void sort(){struct tushu *head;int choice,n=0;there:system("cls”);printf(” ┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n");printf(” ┃┃socat 图书借阅系统┃┃\n");printf(" ┃┗━━━━━━━━━━━━━━━━━━━┛┃\n”);printf(" ┃●[0]返回┃\n”);printf(” ┃┃\n");printf(” ┃●[1]按时间排序┃\n”);printf(” ┃┃\n”);printf(” ┃●[2]按价格排序┃\n");printf(" ┃┃\n”);printf(” ┃●[3]按编号排序┃\n”);printf(" ┃┃\n”);printf(” ┃●┃\n”);printf(”┗━━━━━━━━━━━━━━━━━━━━━━━┛\n”);printf(" 请选择:”);fflush(stdin);head=create();scanf("%d",&choice);if(choice==1){system("cls”); Sort_time(head);}else if(choice==2){sys tem(”cls");Sort_price(head);}else if(choice==3){system(”cls”);Sort_num(head); }else if(choice==0){system("cls”); menu();}else{system(”cls");printf("\n\n\n\n ━━━━输入错误,请重新输入!━━━━\n\n\n ”);system(”pause”);system(”cls”);n++;if(n==3){printf(” \n\n\n ━━━━━━━━你错误次数太多,自动退出! ━━━━━━━━\n\n\n”);printf(” ━━━━━━━━感谢使用图书借阅系统━━━━━━━━\n\n\n”);system("pause”);exit(0);}goto there;}}struct tushu *Input(){struct tushu *p1,*p2,*head,*ptr;char num;int x,i=0;system("cls”);p1=(struct tushu *)malloc(sizeof(struct tushu));head=p1;p1-〉price=—1;while(i!=1){printf(”请输入编号,以’#’结束\n”);scanf("%s",p1—>num);if(strcmp(p1-〉num,”#")==0)i=1;while(i!=1){printf(”请依次输入书名作者出版社类别出版时间价格\n”); scanf(”%s%s%s%s%lf%lf”,p1—>name,p1—>writer,p1—〉press,p1-〉kind,&p1-〉time,&p1—〉price);p2=p1;p1=(struct tushu *)malloc(sizeof(struct tushu));p2—〉next=p1;break;}}if(p1-〉price!=-1)p2—〉next=NULL;elsehead=NULL;system("cls”);printf("\n\n\n\t\t\t图书信息输入结束!\n\n\n”);system(”pause”);system(”cls”);printf(”\n\n\n\t\t\t是否保存图书信息?(1。

相关文档
最新文档