软件技术报告:图书管理系统的设计与实现
系统的需求分析
图书登记管理系统作为一个应用软件将为学校的老师和学生提供一个对学校图书馆深入了解并借阅、还书的平台。根据系统界面的提示信息对图书馆信息进行查询、初始化等操作
1.基本要求
(1)主菜单:管理员、读者信息。
(2)管理员操作:注册,登录。查询,删除,增加读者信息。
新书上架(插入)。图书处理(删除)。图书丢失(删除)。图书借阅,归还处理。
(3)读者操作:注册,登录。查询。借书。还书。丢失赔偿。借书本书上线。借书期限。
(4)图书信息:ID 类别 书名 作者 出版年 出版社 单价 现存数量。
2.算法说明
下面从系统的整体流程的功能模块、系统界面及数据结构进行总体设计。
总体思想
本系统主要设计思想是实现图书馆的功能机管理系统信息的查询、借书、还书等主要功能。系统的设计方法是结构化实际方法,系统用C语言进行开发用户可以清晰的了解图书馆内的情况。
系统模块结构图
根据需求分析结果,图书管理系统可以分为两大大模块:管理员模块、读者模块。
系统模块结构如图:
系统的概要设计
系统主菜单。
显示系统的主菜单,里面有相应的功能代码,根据选择各功能代码进入不同的界面。功能主要包括:退出系统、查询图书、借书、还书。
系统说明
系统文件夹
Administator储存的是管理员信息。
第一行为管理员数量
后续行分别为管理员ID和管理员密码
Book储存的是图书信息
第一行为图书数量
后续行为图书ID 类别 书名 作者 出版年 出版社 单价 现存数量。
Reader储存的是读者信息
第一行储存的是读者数量
后续行储存的分别是读者ID 密码 要赔多少钱 借的书数量 借的书名
3.算法分析与设计
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <fstream>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define LD long double
#define sqr(x) (x)*(x)
const int MAXN = 5005;
const int MAXM = 30;
const int INF = 0x7fffffff;
const int MOD = 1e9+9;
const double eps = 1e-5;
const int Upbooks = 10;
struct BOOKS{
char id[100];
char type[100];
char name[100];
char author[100];
char press[100];
int year, price, quantity;
}books[100010]; //图书结构体
struct READERS{
char id[100];
char name[100];
char borrow[11][100];
int quantity, price;
}readers[100010]; //读者结构体
map <string, string> amp, rmp; //string分别存入ID 密码
map <string, int> amp1, rmp1; //string分别存入ID 和数量用作注册判重。
char TheReader[100], TheBook[100], book_ID[100], reader_ID[100];
char st[10], stt[10], aid[100], Aid[100], apw[100], Apw[100], rid[100], Rid[100], rpw[100], Rpw[100];
int nbooks, nreaders, nad; //储存信息数组
void fuzhi(char *a, char *b) {
int l = strlen(b);
for (int i=0; i<l; ++i) a[i] = b[i];
}
//赋值子函数
void readln() {
ifstream icin;
icin.open("");
icin>>nbooks;
char s1[10], s2[10], s3[10], s4[10], s5[10], s6[10], s7[10], s8[10];
c语言算法书籍 icin>>s1>>s2>>s3>>s4>>s5>>s6>>s7>>s8;
for (int i=1; i<=nbooks; ++i) {
icin>>books[i].id>>books[i].type>>books[i].name>>books[i].author>>books[i].press>>books[i].year>>books[i].quantity>>books[i].price;
} //读入图书数据函数
icin.close();
// //ifstream icin;
icin.open("");
icin>>nad;
char str1[100], str2[100];
for (int i=1; i<=nad; ++i) {
icin>>str1>>str2;
amp[string(str1)] = string(str2);
amp1[string(str1)] = 1;
//cout<<amp1["xinyide"]<<endl;
}
icin.close();
ifstream icin1;
icin.open("");
icin>>nreaders;
for (int i=1; i<=nreaders; ++i) {
icin>>str1>>str2>>readers[i].price>>readers[i].quantity;
fuzhi(readers[i].id, str1);
rmp[string(str1)] = string(str2);
rmp1[string(str1)] = 1;
for (int j=1; j<=readers[i].quantity; ++j) {
icin>>readers[i].borrow[j];
}
}
icin.close();
}
void writeln() {
ofstream ocout;
ocout.open("");
ocout<<nbooks<<endl;
ocout<<"ID type name author press year quantity price"<<endl;
for (int i=1; i<=nbooks; ++i) {
//printf("%s %s %s %s %s %d %d %d\n", books[i].id, books[i].type, book[i].name, books[i].author, books[i].press, books[i].year, books[i].price, books[i].quantity);
ocout<<books[i].id<<" "<<books[i].type<<" "<<books[i].name<<" "<<books[i].author<<" "<<books[i].press<<" "<<books[i].year<<" "<<books[i].quantity<<" "<<books[i].price<<endl;
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论