|
|
|
@ -134,3 +134,98 @@ Which book you wanna revise ?
|
|
|
|
|
2
|
|
|
|
|
No such book
|
|
|
|
|
``````
|
|
|
|
|
# 概要设计
|
|
|
|
|
系统主要分为用户界面和数据处理两大模块。
|
|
|
|
|
|
|
|
|
|
用户界面模块包括系统初始化(init),显示菜单(display_menu),选择菜单命令
|
|
|
|
|
(make_choice)、确认(confirm)、退出(quit)等子模块。
|
|
|
|
|
数据处理模块包括 添加图书( DoAddBook ) 、查找图书( DoFindBook ) 、删除图书( DoDeleteBook ) 、打印所有图书( DoPrintBook ) 、归还图书( DoRepaidBook ) 、借用图书 ( DoBoorowBook ) 、修改图书( DoReviseBook ) 、排序图书( DoSortBook )等子模块。
|
|
|
|
|
|
|
|
|
|
其中查询、添加、修改和删除数据还会用到根据编号查询数据的方法(find)。
|
|
|
|
|
上述各模块通过主程序(main)进行调用,系统模块图如下。
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
各模块的主要功能如下:
|
|
|
|
|
## main
|
|
|
|
|
系统主函数模块,显示菜单,根据用户选择的菜单命令,执行相关操作。
|
|
|
|
|
## init
|
|
|
|
|
系统初始化。
|
|
|
|
|
## display_menu
|
|
|
|
|
显示菜单命令。
|
|
|
|
|
# 详细设计
|
|
|
|
|
针对概要设计
|
|
|
|
|
## main
|
|
|
|
|
```
|
|
|
|
|
Step 1: 初始化
|
|
|
|
|
Step 2: 根据用户选择的命令执行对应的操作
|
|
|
|
|
Step 2.1: 显示菜单
|
|
|
|
|
Step 2.2: 选择菜单命令 c
|
|
|
|
|
Step 2.3: if c == CMD_PRINT then 打印数据
|
|
|
|
|
Step 2.4:
|
|
|
|
|
```
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## DoAddBook
|
|
|
|
|
```
|
|
|
|
|
Step 1: if 数据库满 then 提示数据库满并结束
|
|
|
|
|
Step 2: 输入图书编号
|
|
|
|
|
Step 3: 输入图书名和书籍数量
|
|
|
|
|
Step 4: 添加新书籍
|
|
|
|
|
Step 5: 提示添加成功
|
|
|
|
|
```
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|