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


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

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

第五步全部整合到一起

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

实现页面结果如下:
我做了一些显示上的改动,把User菜单上的hello换到了登录那里,然后在操作那里加上了一条分隔线。
这就是做一个图书管理系统(简易版)的所有步骤,代码我上传到git上面了,需要的自取,关于其它业务逻辑的实现我前一天上传的那个文件有。代码链接
修改:我在这个链接里又添加了BF算法和KMP算法大家照常点进去就行了
边栏推荐
- 堆排序【手写小根堆】
- Answer to "software testing" exercise: Chapter 1
- Fairygui joystick
- isEmpty 和 isBlank 的用法区别
- [algorithm] sword finger offer2 golang interview question 5: maximum product of word length
- The earth revolves around the sun
- Realization of the code for calculating the mean square error of GPS Height Fitting
- 一文搞定 UDP 和 TCP 高频面试题!
- 平衡二叉树详解 通俗易懂
- [algorithm] sword finger offer2 golang interview question 3: the number of 1 in the binary form of the first n numbers
猜你喜欢

Role movement in the first person perspective

FairyGUI条子家族(滚动条,滑动条,进度条)

Dark chain lock (lca+ difference on tree)

Fabrication d'un sac à dos simple fairygui

RTKLIB: demo5 b34f.1 vs b33

Wechat applet development experience
![[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k](/img/65/fc3fb5a217a3b44f506b695af53e2c.png)
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k

面渣逆袭:Redis连环五十二问,三万字+八十图详解。

Experience summary of autumn recruitment of state-owned enterprises

2022国赛Re1 baby_tree
随机推荐
【GNSS数据处理】赫尔默特(helmert)方差分量估计解析及代码实现
[rtklib 2.4.3 B34] version update introduction I
The earth revolves around the sun
FairyGUI循環列錶
GPS高程拟合抗差中误差的求取代码实现
[algorithm] sword finger offer2 golang interview question 13: sum of numbers of two-dimensional submatrix
Record: solution of 404 error of servlet accessing database in dynamic web project
121道分布式面试题和答案
地球围绕太阳转
Chromatic judgement bipartite graph
Sharing ideas of on-chip transplantation based on rtklib source code
[算法] 剑指offer2 golang 面试题10:和为k的子数组
Fairygui joystick
记录:newInstance()过时的代替方法
Fabrication of fairygui simple Backpack
Agile development helps me
[algorithm] sword finger offer2 golang interview question 2: binary addition
VLSM variable length subnet mask partition tips
Fairygui gain buff value change display
KF UD分解之UD分解基础篇【1】