当前位置:网站首页>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
边栏推荐
- [算法] 剑指offer2 golang 面试题4:只出现一次的数字
- On March 15, the official version of go 1.18 was released to learn about the latest features and usage
- 分支语句和循环语句
- Detailed explanation of balanced binary tree is easy to understand
- TYUT太原理工大学2022“mao gai”必背
- Redis介绍与使用
- 162. Find peak - binary search
- 【干货】提升RTK模糊度固定率的建议之周跳探测
- Code example of MATLAB reading GNSS observation value o file
- 继承和多态(上)
猜你喜欢

rtklib单点定位spp使用抗差估计遇到的问题及解决
![[算法] 剑指offer2 golang 面试题10:和为k的子数组](/img/63/7422489d09a64ec9f0e79378761bf1.png)
[算法] 剑指offer2 golang 面试题10:和为k的子数组
![[algorithm] sword finger offer2 golang interview question 3: the number of 1 in the binary form of the first n numbers](/img/64/0f352232359c7d44f12b20a64c7bb4.png)
[algorithm] sword finger offer2 golang interview question 3: the number of 1 in the binary form of the first n numbers

MYSQL索引钟B-TREE ,B+TREE ,HASH索引之间的区别和应用场景

MySQL 三万字精华总结 + 面试100 问,吊打面试官绰绰有余(收藏系列

2年经验总结,告诉你如何做好项目管理

Experience summary of autumn recruitment of state-owned enterprises
![[untitled]](/img/b1/9a2bebebb24132a405fc4e7d854e51.png)
[untitled]

C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)

系统设计学习(一)Design Pastebin.com (or Bit.ly)
随机推荐
系统设计学习(一)Design Pastebin.com (or Bit.ly)
面试必备:聊聊分布式锁的多种实现!
Excel导入,导出功能实现
平衡二叉树详解 通俗易懂
Role movement in the first person perspective
Fundamentals of UD decomposition of KF UD decomposition [1]
Iterable、Collection、List 的常见方法签名以及含义
3月15号 Go 1.18 正式版发布 了解最新特色以及使用方法
[算法] 剑指offer2 golang 面试题10:和为k的子数组
[algorithm] sword finger offer2 golang interview question 10: subarray with sum K
Implementation of Excel import and export functions
Fairygui bar subfamily (scroll bar, slider, progress bar)
Edit distance (multi-source BFS)
[rtklib] preliminary practice of using robust adaptive Kalman filter under RTK
抽象类和接口
面渣逆袭:Redis连环五十二问,三万字+八十图详解。
编辑距离(多源BFS)
Tyut Taiyuan University of technology 2022 introduction to software engineering
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array
【无标题】