- C++项目开发全程实录(第2版)
- 明日科技编著
- 226字
- 2025-02-27 20:09:44
1.6 添加新书模块设计

视频讲解
1.6.1 添加新书模块概述
在图书管理系统主窗体中输入数字1,则进入到添加新书模块中。在添加新书模块中,用户需要输入所要添加的图书的书名、ISBN编码、价格以及作者信息,其运行效果如图1.7所示。

图1.7 添加新书
1.6.2 添加新书模块技术分析
在添加新书模块中定义了GuideInput函数,通过在main函数中调用来完成添加图书的功能。
void GuideInput();
其次,利用CBook类构建一个CBook对象,通过CBook对象的成员函数WriteData将图书信息写入文件。
CBook book(inName,inIsbn,inPrice,inAuthor); book.WriteData();
1.6.3 添加新书模块实现过程
图书管理系统中添加新书模块的实现代码如下:
