|
|
@ -43,18 +43,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## C1:函数模块
|
|
|
|
## C1:函数模块
|
|
|
|
|
|
|
|
|
|
|
|
1.函数原形:int main();
|
|
|
|
1.函数原形:int main();
|
|
|
|
2.功能:调用ShowMainMenu()函数,显示主界面
|
|
|
|
2.功能:调用ShowMainMenu()函数,显示主界面
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ShowMainMenu()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
system("cls");
|
|
|
|
|
|
|
|
printf("\n\n\n\n\n");
|
|
|
|
|
|
|
|
printf("\t|----------------------欢迎进入---------------------------\n");
|
|
|
|
|
|
|
|
printf("\t| 读者管理系统 \n");
|
|
|
|
|
|
|
|
printf("\t| 1、查询图书馆的总信息 \n");
|
|
|
|
|
|
|
|
printf("\t| 2、查询图书馆藏书信息 \n");
|
|
|
|
|
|
|
|
printf("\t| 3、存入新书 \n");
|
|
|
|
|
|
|
|
printf("\t| 4、旧书处理 \n");
|
|
|
|
|
|
|
|
printf("\t| 5、根据书名检索书刊信息 \n");
|
|
|
|
|
|
|
|
printf("\t| 6、查询读者的借阅信息 \n");
|
|
|
|
|
|
|
|
printf("\t| 7、查询读者信息 \n");
|
|
|
|
|
|
|
|
printf("\t| 8、读者借书 \n");
|
|
|
|
|
|
|
|
printf("\t| 9、读者还书 \n");
|
|
|
|
|
|
|
|
printf("\t| 10、文件保存 \n");
|
|
|
|
|
|
|
|
printf("\t| 11、从文件读取 \n");
|
|
|
|
|
|
|
|
printf("\t| 0、退出 \n");
|
|
|
|
|
|
|
|
printf("\t|---------------------------------------------------------\n");
|
|
|
|
|
|
|
|
printf("新打开程序需先添加管理员\n");
|
|
|
|
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
printf("\t\t请选择(0-11):");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C2:查询图书馆信息模块
|
|
|
|
## C2:查询图书馆信息模块
|
|
|
|
|
|
|
|
|
|
|
|
函数原形:void ShowLibInfo(const Book* book, const Reader* reader);
|
|
|
|
函数原形:void ShowLibInfo(const Book* book, const Reader* reader);
|
|
|
|
功能:接受两个形参,分别是图书的链表地址,读者的链表地址,并遍历两个链表,显示出图书的数量和读者的数量
|
|
|
|
功能:接受两个形参,分别是图书的链表地址,读者的链表地址,并遍历两个链表,显示出图书的数量和读者的数量
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
void ShowLibInfo(const Book* book1, const Reader* reader1)
|
|
|
|
void ShowLibInfo(const Book* book1, const Reader* reader1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Book* book = book1;
|
|
|
|
Book* book = book1;
|
|
|
@ -76,7 +101,6 @@ void ShowLibInfo(const Book* book1, const Reader* reader1)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C3:查找图书馆藏书信息模块
|
|
|
|
## C3:查找图书馆藏书信息模块
|
|
|
@ -97,8 +121,6 @@ void ShowLibBook(Book* book1)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C4:存入新书信息模块
|
|
|
|
## C4:存入新书信息模块
|
|
|
@ -171,9 +193,6 @@ Book* AddBook(Book* book1)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C5:旧书处理信息模块
|
|
|
|
## C5:旧书处理信息模块
|
|
|
@ -181,6 +200,7 @@ Book* AddBook(Book* book1)
|
|
|
|
1)函数原形: Book* DealoldBook(Book* book);
|
|
|
|
1)函数原形: Book* DealoldBook(Book* book);
|
|
|
|
2) 功能: 接受一个形参:图书链表的地址,遍历该链表,用书的编号进行匹配,找到该图书后删除该图书,否则返回
|
|
|
|
2) 功能: 接受一个形参:图书链表的地址,遍历该链表,用书的编号进行匹配,找到该图书后删除该图书,否则返回
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Book* DealoldBook(Book* book1)
|
|
|
|
Book* DealoldBook(Book* book1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Book* book = book1;
|
|
|
|
Book* book = book1;
|
|
|
@ -215,7 +235,6 @@ Book* DealoldBook(Book* book1)
|
|
|
|
return book1;
|
|
|
|
return book1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C6:查找图书信息模块
|
|
|
|
## C6:查找图书信息模块
|
|
|
@ -223,6 +242,7 @@ Book* DealoldBook(Book* book1)
|
|
|
|
1)函数原形: void foundBook(Book* book);
|
|
|
|
1)函数原形: void foundBook(Book* book);
|
|
|
|
2) 功能:接受一个形参:图书链表的地址,遍历该链表,用书的编号进行匹配,找到该图书后显示该图书,否则返回
|
|
|
|
2) 功能:接受一个形参:图书链表的地址,遍历该链表,用书的编号进行匹配,找到该图书后显示该图书,否则返回
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
void foundBook(Book* book1)
|
|
|
|
void foundBook(Book* book1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Book* book = book1;
|
|
|
|
Book* book = book1;
|
|
|
@ -248,9 +268,6 @@ void foundBook(Book* book1)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C7:查询读者借阅信息模块
|
|
|
|
## C7:查询读者借阅信息模块
|
|
|
@ -258,6 +275,7 @@ void foundBook(Book* book1)
|
|
|
|
1)函数原形: void foundReader_Info(Reader* reader);
|
|
|
|
1)函数原形: void foundReader_Info(Reader* reader);
|
|
|
|
2) 功能: 接受一个形参:读者链表的地址,遍历该链表,用读者的编号进行匹配,找到该读者显示该读者的信息,否则返回
|
|
|
|
2) 功能: 接受一个形参:读者链表的地址,遍历该链表,用读者的编号进行匹配,找到该读者显示该读者的信息,否则返回
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
void foundReader_Info(Reader* reader1)
|
|
|
|
void foundReader_Info(Reader* reader1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Reader* reader = reader1; //备份
|
|
|
|
Reader* reader = reader1; //备份
|
|
|
@ -289,8 +307,6 @@ void foundReader_Info(Reader* reader1)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## C8:查询读者借书模块
|
|
|
|
## C8:查询读者借书模块
|
|
|
@ -298,6 +314,7 @@ void foundReader_Info(Reader* reader1)
|
|
|
|
1)函数原形: void foundReaderInfo(Reader* reader);
|
|
|
|
1)函数原形: void foundReaderInfo(Reader* reader);
|
|
|
|
2)功能: 接受一个形参:读者链表的地址,遍历该链表,用读者的编号进行匹配,找到该读者显示该读者的借阅信息,否则返回
|
|
|
|
2)功能: 接受一个形参:读者链表的地址,遍历该链表,用读者的编号进行匹配,找到该读者显示该读者的借阅信息,否则返回
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
void foundReaderInfo(Reader* reader1)
|
|
|
|
void foundReaderInfo(Reader* reader1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Reader* reader = reader1;
|
|
|
|
Reader* reader = reader1;
|
|
|
@ -333,6 +350,7 @@ void foundReaderInfo(Reader* reader1)
|
|
|
|
1)函数原形: Reader* LendBook(Reader* reader, Book* book);
|
|
|
|
1)函数原形: Reader* LendBook(Reader* reader, Book* book);
|
|
|
|
2)功能:接受两个形参:读者链表地址和图书链表地址,用读者的编号进行匹配,找到该读者后,用图书的编号进行匹配,进行借书,否则返回
|
|
|
|
2)功能:接受两个形参:读者链表地址和图书链表地址,用读者的编号进行匹配,找到该读者后,用图书的编号进行匹配,进行借书,否则返回
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Reader* LendBook(Reader* reader1, Book* book1)
|
|
|
|
Reader* LendBook(Reader* reader1, Book* book1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Reader* reader = reader1;
|
|
|
|
Reader* reader = reader1;
|
|
|
@ -499,7 +517,7 @@ Reader* LendBook(Reader* reader1, Book* book1)
|
|
|
|
文件保存
|
|
|
|
文件保存
|
|
|
|
从文件读取
|
|
|
|
从文件读取
|
|
|
|
上述各模块通过主程序(main)进行调用,系统模块图如下:
|
|
|
|
上述各模块通过主程序(main)进行调用,系统模块图如下:
|
|
|
|
|
|
|
|
![](images/text.drawio.svg)
|
|
|
|
|
|
|
|
|
|
|
|
## 详细设计
|
|
|
|
## 详细设计
|
|
|
|
针对概要设计
|
|
|
|
针对概要设计
|
|
|
@ -508,16 +526,12 @@ C2:void ShowLibInfo(const Book* book, const Reader* reader);\\查询图书馆的
|
|
|
|
![C2](c2.svg)
|
|
|
|
![C2](c2.svg)
|
|
|
|
C3:void ShowLibBook(Book* book);\\查询图书馆藏书信息
|
|
|
|
C3:void ShowLibBook(Book* book);\\查询图书馆藏书信息
|
|
|
|
![c3](images/c3.svg)
|
|
|
|
![c3](images/c3.svg)
|
|
|
|
)
|
|
|
|
|
|
|
|
C4:Book* AddBook(Book* book);\\存入新书
|
|
|
|
C4:Book* AddBook(Book* book);\\存入新书
|
|
|
|
![c4](images/c4.svg)
|
|
|
|
![c4](images/c4.svg)
|
|
|
|
|
|
|
|
|
|
|
|
C5:Book* DealoldBook(Book* book);\\旧书处理
|
|
|
|
C5:Book* DealoldBook(Book* book);\\旧书处理
|
|
|
|
|
|
|
|
|
|
|
|
![c5](images/c5.svg)
|
|
|
|
![c5](images/c5.svg)
|
|
|
|
C6:void foundBook(Book* book);\\根据书名检索书刊信息
|
|
|
|
C6:void foundBook(Book* book);\\根据书名检索书刊信息
|
|
|
|
![C6](images/foundbook.svg)
|
|
|
|
![C6](images/foundbook.svg)
|
|
|
|
|
|
|
|
|
|
|
|
C7:void foundReader_Info(Reader* reader);\\查询读者的借阅信息
|
|
|
|
C7:void foundReader_Info(Reader* reader);\\查询读者的借阅信息
|
|
|
|
![C7](images/foundreaderinfo.svg)
|
|
|
|
![C7](images/foundreaderinfo.svg)
|
|
|
|
C8:void foundReaderInfo(Reader* reader);\\查询读者信息
|
|
|
|
C8:void foundReaderInfo(Reader* reader);\\查询读者信息
|
|
|
|