当前位置:网站首页>图书管理系统小练习
图书管理系统小练习
2022-07-06 09:19:00 【犇犇犇犇犇犇】
做一个图书管理小练习用来总结前面所学过的语法知识。
这个练习,我们只注重框架如何构成,不注重业务逻辑的实现。
第一步对图书这个对象进行抽象
书有哪些属性:
书名,作者名,书的价格,书的类型,是否被借出
如何存放这些图书?
创建一个书架类,
书的数量,有些什么书
同时用idea生成set、get方法,构造方法(不用加入是否被借出属性,图书默认未借出),和重写toString方法。第二步对书架上的书进行一些操作
当我们查找一本书时,需要通过下标返回书的属性
当我们要增加/删除一本书时,需要设置一本书的属性和添加的位置
所以我们需要对books数组和useSize进行set和get操作。
我们可以把对书架的所有操作都写在这个类中,但是为了后面操作方便我额外再创建一个包来设置对书架的操作第三步对书架进行的管理操作
- 查找图书
- 新增图书
- 删除图书
- 显示图书
- 退出系统
因为这些操作都是对书架进行工作,所以用一个接口把他们规范起来
第四步管理员操作菜单实现
第五步全部整合到一起
第六步业务逻辑的实现(我只实现一个显示图书)
实现页面结果如下:
我做了一些显示上的改动,把User菜单上的hello换到了登录那里,然后在操作那里加上了一条分隔线。
这就是做一个图书管理系统(简易版)的所有步骤,代码我上传到git上面了,需要的自取,关于其它业务逻辑的实现我前一天上传的那个文件有。代码链接
修改:我在这个链接里又添加了BF算法和KMP算法大家照常点进去就行了
边栏推荐
- 记录:Navicat Premium初次无法连接数据库MySQL之解决
- How to reduce the shutdown time of InnoDB database?
- [algorithm] sword finger offer2 golang interview question 8: the shortest subarray with a sum greater than or equal to K
- KF UD分解之UD分解基础篇【1】
- The earth revolves around the sun
- [GNSS data processing] Helmert variance component estimation analysis and code implementation
- Music playback (toggle & playerprefs)
- Record: I accidentally wrote a recursion next time
- 121 distributed interview questions and answers
- Containers and Devops: container based Devops delivery pipeline
猜你喜欢
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
【GNSS数据处理】赫尔默特(helmert)方差分量估计解析及代码实现
How do architects draw system architecture blueprints?
Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY
[algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
2022国赛Re1 baby_tree
【无标题】
架构师怎样绘制系统架构蓝图?
音乐播放(Toggle && PlayerPrefs)
Mysql database index
随机推荐
Shortest Hamilton path (pressure DP)
【rtklib】在rtk下使用抗差自适应卡尔曼滤波初步实践
Excel导入,导出功能实现
Fairygui character status Popup
记录:下一不小心写了个递归
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
FairyGUI按钮动效的混用
Containers and Devops: container based Devops delivery pipeline
C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)
阿里云一面:并发场景下的底层细节 - 伪共享问题
[算法] 剑指offer2 golang 面试题2:二进制加法
Code example of MATLAB reading GNSS observation value o file
FairyGUI簡單背包的制作
[算法] 剑指offer2 golang 面试题9:乘积小于k的子数组
Fabrication d'un sac à dos simple fairygui
The port is occupied because the service is not shut down normally
What are the advantages of using SQL in Excel VBA
基于rtklib源码进行片上移植的思路分享
3月15号 Go 1.18 正式版发布 了解最新特色以及使用方法
MySQL backup -- common errors in xtrabackup backup