当前位置:网站首页>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
边栏推荐
- 记录:newInstance()过时的代替方法
- The earth revolves around the sun
- 系统设计学习(二)Design a key-value cache to save the results of the most recent web server queries
- Problems and solutions of robust estimation in rtklib single point location spp
- 面试必备:聊聊分布式锁的多种实现!
- Sharing ideas of on-chip transplantation based on rtklib source code
- [algorithm] sword finger offer2 golang interview question 10: subarray with sum K
- GNSS positioning accuracy index calculation
- TYUT太原理工大学2022软工导论大题汇总
- 平衡二叉树详解 通俗易懂
猜你喜欢
Edit distance (multi-source BFS)
[Chongqing Guangdong education] Shandong University College Physics reference materials
Iterable、Collection、List 的常见方法签名以及含义
Chromatic judgement bipartite graph
Fgui project packaging and Publishing & importing unity & the way to display the UI
[算法] 剑指offer2 golang 面试题13:二维子矩阵的数字之和
Fairygui bar subfamily (scroll bar, slider, progress bar)
堆排序【手写小根堆】
几道高频的JVM面试题
Application architecture of large live broadcast platform
随机推荐
XV Function definition and call
What are the advantages of using SQL in Excel VBA
[algorithm] sword finger offer2 golang interview question 2: binary addition
阿里云一面:并发场景下的底层细节 - 伪共享问题
Answer to "software testing" exercise: Chapter 1
Lean product development - Lean Software Development & lean product development
Shortest Hamilton path (pressure DP)
Comparative analysis of the execution efficiency of MySQL 5.7 statistical table records
How to reduce the shutdown time of InnoDB database?
Detailed explanation of balanced binary tree is easy to understand
面渣逆袭:Redis连环五十二问,三万字+八十图详解。
异常:IOException:Stream Closed
Usage differences between isempty and isblank
Pride-pppar source code analysis
分支语句和循环语句
编辑距离(多源BFS)
【无标题】
2022 National Games RE1 baby_ tree
【干货】提升RTK模糊度固定率的建议之周跳探测
isEmpty 和 isBlank 的用法区别