当前位置:网站首页>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
边栏推荐
- Introduction pointer notes
- TYUT太原理工大学2022软工导论大题汇总
- 异常:IOException:Stream Closed
- Comparative analysis of the execution efficiency of MySQL 5.7 statistical table records
- 分支语句和循环语句
- [算法] 剑指offer2 golang 面试题1:整数除法
- [algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
- What are the advantages of using SQL in Excel VBA
- 继承和多态(下)
- Heap sort [handwritten small root heap]
猜你喜欢

Wechat applet development experience

TYUT太原理工大学2022软工导论大题汇总

121 distributed interview questions and answers

What are the advantages of using SQL in Excel VBA

【GNSS数据处理】赫尔默特(helmert)方差分量估计解析及代码实现

MySQL 三万字精华总结 + 面试100 问,吊打面试官绰绰有余(收藏系列
![[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

Dark chain lock (lca+ difference on tree)

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

面渣逆袭:Redis连环五十二问,三万字+八十图详解。
随机推荐
记录:newInstance()过时的代替方法
Exception: ioexception:stream closed
Answer to "software testing" exercise: Chapter 1
Containers and Devops: container based Devops delivery pipeline
[算法] 剑指offer2 golang 面试题4:只出现一次的数字
Detailed explanation of balanced binary tree is easy to understand
165. Compare version number - string
RTKLIB: demo5 b34f. 1 vs b33
[算法] 剑指offer2 golang 面试题1:整数除法
继承和多态(下)
[算法] 劍指offer2 golang 面試題2:二進制加法
Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
Dark chain lock (lca+ difference on tree)
Record: Navicat premium can't connect to MySQL for the first time
[算法] 剑指offer2 golang 面试题5:单词长度的最大乘积
Redis介绍与使用
【GNSS】抗差估计(稳健估计)原理及程序实现
What are the advantages of using SQL in Excel VBA
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal