当前位置:网站首页>图书管理系统小练习
图书管理系统小练习
2022-07-06 09:19:00 【犇犇犇犇犇犇】
做一个图书管理小练习用来总结前面所学过的语法知识。
这个练习,我们只注重框架如何构成,不注重业务逻辑的实现。
第一步对图书这个对象进行抽象
书有哪些属性:
书名,作者名,书的价格,书的类型,是否被借出
如何存放这些图书?
创建一个书架类,
书的数量,有些什么书
同时用idea生成set、get方法,构造方法(不用加入是否被借出属性,图书默认未借出),和重写toString方法。
第二步对书架上的书进行一些操作
当我们查找一本书时,需要通过下标返回书的属性
当我们要增加/删除一本书时,需要设置一本书的属性和添加的位置
所以我们需要对books数组和useSize进行set和get操作。


我们可以把对书架的所有操作都写在这个类中,但是为了后面操作方便我额外再创建一个包来设置对书架的操作第三步对书架进行的管理操作
- 查找图书
- 新增图书
- 删除图书
- 显示图书
- 退出系统
因为这些操作都是对书架进行工作,所以用一个接口把他们规范起来

第四步管理员操作菜单实现

第五步全部整合到一起

第六步业务逻辑的实现(我只实现一个显示图书)

实现页面结果如下:
我做了一些显示上的改动,把User菜单上的hello换到了登录那里,然后在操作那里加上了一条分隔线。
这就是做一个图书管理系统(简易版)的所有步骤,代码我上传到git上面了,需要的自取,关于其它业务逻辑的实现我前一天上传的那个文件有。代码链接
修改:我在这个链接里又添加了BF算法和KMP算法大家照常点进去就行了
边栏推荐
- [algorithm] sword finger offer2 golang interview question 13: sum of numbers of two-dimensional submatrix
- 【RTKLIB 2.4.3 b34 】版本更新简介一
- 系统设计学习(三)Design Amazon‘s sales rank by category feature
- Devops' future: six trends in 2022 and beyond
- 架构师怎样绘制系统架构蓝图?
- The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan
- GNSS positioning accuracy index calculation
- Usage differences between isempty and isblank
- 错误:排序与角标越界
- [算法] 剑指offer2 golang 面试题2:二进制加法
猜你喜欢
![[算法] 剑指offer2 golang 面试题10:和为k的子数组](/img/63/7422489d09a64ec9f0e79378761bf1.png)
[算法] 剑指offer2 golang 面试题10:和为k的子数组

染色法判定二分图

Implementation of Excel import and export functions
![Heap sort [handwritten small root heap]](/img/f0/6efda3c6f499a32671a935dd2f21db.png)
Heap sort [handwritten small root heap]
![[算法] 剑指offer2 golang 面试题9:乘积小于k的子数组](/img/65/fc3fb5a217a3b44f506b695af53e2c.png)
[算法] 剑指offer2 golang 面试题9:乘积小于k的子数组

2022国赛Re1 baby_tree

【GNSS数据处理】赫尔默特(helmert)方差分量估计解析及代码实现
![[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array](/img/d5/4bda133498f71ae9fd7a64c6cba8f0.png)
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array
![[算法] 剑指offer2 golang 面试题2:二进制加法](/img/c2/6f6c3bd4d70252ba73addad6a3a9c1.png)
[算法] 剑指offer2 golang 面试题2:二进制加法
![[GNSS data processing] Helmert variance component estimation analysis and code implementation](/img/4e/ff0334cf9a2a37096778a8c5719a4e.jpg)
[GNSS data processing] Helmert variance component estimation analysis and code implementation
随机推荐
[算法] 剑指offer2 golang 面试题10:和为k的子数组
rtklib单点定位spp使用抗差估计遇到的问题及解决
【RTKLIB 2.4.3 b34 】版本更新简介一
XV Function definition and call
341. Flatten nested list iterator
Record: the solution of MySQL denial of access when CMD starts for the first time
基本Dos命令
The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan
[算法] 剑指offer2 golang 面试题13:二维子矩阵的数字之和
[算法] 剑指offer2 golang 面试题8:和大于或等于k的最短子数组
Dark chain lock (lca+ difference on tree)
记录:Navicat Premium初次无法连接数据库MySQL之解决
Fairygui joystick
FGUI工程打包发布&导入Unity&将UI显示出来的方式
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
Devops' future: six trends in 2022 and beyond
Matlab读取GNSS 观测值o文件代码示例
[algorithm] sword finger offer2 golang interview question 10: subarray with sum K
PRIDE-PPPAR源码解析
On March 15, the official version of go 1.18 was released to learn about the latest features and usage