当前位置:网站首页>Small exercise of library management system
Small exercise of library management system
2022-07-06 13:08:00 【犇犇犇犇犇犇犇】
Do a small exercise of library management to summarize the grammar knowledge learned before .
This exercise , We only pay attention to how the framework is formed , Do not pay attention to the implementation of business logic .
The first step is to abstract the object of book
What are the attributes of books :
Title , The author's name , The price of books , The type of book , Whether to be lent
How to store these books ?
Create a bookshelf class ,
The number of books , What books are there
Simultaneous use idea Generate set、get Method , Construction method ( There is no need to add the attribute of whether to be lent , Books are not lent by default ), And rewrite toString Method .
The second step is to operate the books on the bookshelf
When we look for a book , You need to return the attributes of the book by subscript
When we want to add / When deleting a book , You need to set the properties of a book and add the location
So we need to deal with books Array and useSize Conduct set and get operation .


We can write all operations on bookshelves in this class , But for the convenience of later operation, I will create an additional package to set up the operation of the bookshelfThe third step is to manage the bookshelf
- Look for books
- New books
- Delete books
- Show books
- Exit the system
Because these operations are all for bookshelves , So use an interface to standardize them

Step 4: the administrator operates the menu to realize

Step 5: integrate them all

Step 6 implementation of business logic ( I only implement a display book )

The results of the implementation page are as follows :
I made some display changes , hold User On the menu hello Change to login , Then a separation line is added to the operation .
This is to build a library management system ( Simple version of ) All the steps of , I upload the code to git The above , Self access required , About the implementation of other business logic, the file I uploaded the day before yesterday is . Code link
modify : I added BF Algorithm and KMP Algorithm, just click in as usual
边栏推荐
- rtklib单点定位spp使用抗差估计遇到的问题及解决
- [algorithm] sword finger offer2 golang interview question 7: 3 numbers with 0 in the array
- 121 distributed interview questions and answers
- The earth revolves around the sun
- Compile GDAL source code with nmake (win10, vs2022)
- 抗差估计在rtklib的pntpos函数(标准单点定位spp)中的c代码实现
- MySQL backup -- common errors in xtrabackup backup
- 继承和多态(下)
- Iterable、Collection、List 的常见方法签名以及含义
- XV Function definition and call
猜你喜欢
![[algorithm] sword finger offer2 golang interview question 8: the shortest subarray with a sum greater than or equal to K](/img/8c/1b6ba3b1830ad28176190170c98628.png)
[algorithm] sword finger offer2 golang interview question 8: the shortest subarray with a sum greater than or equal to K

Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing

基本Dos命令

XV Function definition and call

Experience summary of autumn recruitment of state-owned enterprises

【无标题】

Redis介绍与使用

2022国赛Re1 baby_tree

Problems and solutions of robust estimation in rtklib single point location spp

C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)
随机推荐
Usage differences between isempty and isblank
记录:初次cmd启动MySQL拒接访问之解决
[algorithm] sword finger offer2 golang interview question 5: maximum product of word length
Introduction pointer notes
阿里云微服务(一)服务注册中心Nacos以及REST Template和Feign Client
[GNSS] robust estimation (robust estimation) principle and program implementation
一文搞定 UDP 和 TCP 高频面试题!
Fgui project packaging and Publishing & importing unity & the way to display the UI
Devops' future: six trends in 2022 and beyond
[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
平衡二叉树详解 通俗易懂
TYUT太原理工大学2022软工导论考试题型大纲
Application architecture of large live broadcast platform
Compile GDAL source code with nmake (win10, vs2022)
Problems and solutions of robust estimation in rtklib single point location spp
Error: symbol not found
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
Answer to "software testing" exercise: Chapter 1
XV Function definition and call
C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)