当前位置:网站首页>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
边栏推荐
- 抽象类和接口
- Record: I accidentally wrote a recursion next time
- MySQL shutdown is slow
- TYUT太原理工大学2022软工导论简答题
- [算法] 剑指offer2 golang 面试题1:整数除法
- 十分鐘徹底掌握緩存擊穿、緩存穿透、緩存雪崩
- Code example of MATLAB reading GNSS observation value o file
- Application architecture of large live broadcast platform
- Rt-ppp test using rtknavi
- 2022 National Games RE1 baby_ tree
猜你喜欢
Dark chain lock (lca+ difference on tree)
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
TYUT太原理工大学2022数据库大题之概念模型设计
[GNSS data processing] Helmert variance component estimation analysis and code implementation
[算法] 剑指offer2 golang 面试题8:和大于或等于k的最短子数组
Wechat applet development experience
[algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
系统设计学习(一)Design Pastebin.com (or Bit.ly)
MySQL 三万字精华总结 + 面试100 问,吊打面试官绰绰有余(收藏系列
随机推荐
[算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
Comparative analysis of the execution efficiency of MySQL 5.7 statistical table records
Dark chain lock (lca+ difference on tree)
阿里云微服务(二) 分布式服务配置中心以及Nacos的使用场景及实现介绍
[算法] 剑指offer2 golang 面试题2:二进制加法
IText 7 generate PDF summary
How to ensure data consistency between MySQL and redis?
错误: 找不到符号
Fundamentals of UD decomposition of KF UD decomposition [1]
一文搞定 UDP 和 TCP 高频面试题!
Record: I accidentally wrote a recursion next time
面渣逆袭:Redis连环五十二问,三万字+八十图详解。
[algorithm] sword finger offer2 golang interview question 5: maximum product of word length
Pride-pppar source code analysis
染色法判定二分图
阿里云一面:并发场景下的底层细节 - 伪共享问题
使用rtknavi进行RT-PPP测试
How do architects draw system architecture blueprints?
Record: solution of 404 error of servlet accessing database in dynamic web project
[算法] 剑指offer2 golang 面试题5:单词长度的最大乘积