Professional Documents
Culture Documents
LE PHU BINH 1
BOOK MANAGERMENT SYSTEM
Summative Feedback:
Internal verification:
LE PHU BINH 2
BOOK MANAGERMENT SYSTEM
Academic Year
Unit Assessor
Issue Date
Submission Date
IV Name
Date
Submission Format
Each student must submit their assignment as guided in the assignment brief. The students are guided on
what sort of information is to produce to meet the criteria targeted. Some tasks might require group work,
but the student must produce the individual assignment.
LO1. Define basic algorithms to carry out an operation and outline the process of programming an
application.
LO4. Determine the debugging process and explain the importance of a coding standard.
You have been recently recruited as a junior application designer in one of the top IT companies in
Vietnam. iBook hired the company to create a program for the books management system. Each book has
an id, name, author, language, price, publish date, and ISBN.
The system should have at least two main menus which are:
I. Books
II. Tools
LE PHU BINH 3
BOOK MANAGERMENT SYSTEM
Part 1:
You have been tasked with creating a presentation on algorithms and their benefit to software
development.
As the results will need to be delivered to your peers, consider this as a mini-research project that will be
presented.
You will need to explain what an algorithm is, with examples of their use, comparing their efficiency
against brute-forcing, and how it will relate to the application development process, down to the
implementation in a suitable language. The presentation will be most effective if it includes an example
and concludes with an evaluation of the implementation of the algorithm.
Your research should be conducted on a choice of algorithms, including sorting, and searching data
and/or encryption/decryption, compression/decompression.
Note: The submission is in the form of a ten-minute Microsoft® PowerPoint® style presentation, you
should be prepared to present to your colleagues before presenting to the customer. The presentation can
include links to performance data with additional speaker notes. The presentation slides will need to be
submitted with speaker notes. You are required to make effective use of headings, bullet points, and
subsections as appropriate. Your research must be referenced using the Harvard referencing system. The
recommended word limit is 500 words, including speaker notes, although you will not be penalized for
exceeding the total word limit.
Part 2:
The research and development team you work with has been tasked with further investigation into how
best to build more efficient, secure software. You have been asked to investigate programming paradigms
and the advantages and disadvantages of using different programming language approaches.
You will need to create a report covering findings from research into the characteristics of different
programming paradigms – procedural, object-orientated, and event-driven programming.
Your report should include an explanation of each paradigm, an analysis of suitable IDEs, and an
evaluation of source code that would be generated for an application.
Note: The submission is in the form of an individual written report. This should be written in a concise,
formal business style using single spacing and font size 12. You are required to make use of headings,
paragraphs, and subsections as appropriate, and all work must be supported with research and referenced
using the Harvard referencing system. Please also provide a bibliography using the Harvard referencing
system. The recommended word limit is 2,000–2,500 words, although you will not be penalized for
exceeding the total word limit.
Part 3:
You have been asked by your manager to develop a working application following your design and
LE PHU BINH 4
BOOK MANAGERMENT SYSTEM
You are required to make use of appropriate structure, including headings, paragraphs, subsections, and
illustrations as appropriate, and all work must be supported with research and referenced using the
Harvard referencing system.
1. Evidence of how the IDE was used to manage the development of your code.
2. An evaluation of developing applications using an IDE versus developing an application without using
an IDE.
3. An evaluation of the debugging process in the IDE used and how it helped with development.
4. An evaluation of coding standards and the benefits to organizations of using them.
CATALOG
PRODUCTION..............................................................................................................................................................................6
LO1. Define basic algorithms to carry out an operation and outline the process of programming an application.............6
1.Algorithm......................................................................................................................................................................................6
2. Steps to development a program.................................................................................................................................................9
3. Write a program.........................................................................................................................................................................12
LO2. Explain the characteristics of procedural, object-oriented, and event-driven programming....................................13
1. Procedure oriented programming..............................................................................................................................................13
2. Object-orientated programming................................................................................................................................................16
3. Differences between Procedural and Object Oriented Programming.......................................................................................23
4. Event-drive programming..........................................................................................................................................................25
5. The Relationship between Procedure, Object Oriented and Event Driven Programming........................................................33
LO3. Implement basic algorithms in code using an IDE.........................................................................................................34
1. General introduction..................................................................................................................................................................34
2. System Requirements................................................................................................................................................................35
3. Diagram.....................................................................................................................................................................................35
4. Code...........................................................................................................................................................................................37
5. Test............................................................................................................................................................................................47
LO4. Determine the debugging process and explain the importance of a coding standard.................................................55
1. Debugging.................................................................................................................................................................................55
2. The importance of a coding standard........................................................................................................................................61
Referance......................................................................................................................................................................................63
LE PHU BINH 5
BOOK MANAGERMENT SYSTEM
PRODUCTION
Programming is one of the subjects in which students must master the knowledge base, including
understanding programming models such as procedural programming, objectoriented programming, and
event-oriented programming, the structure of a program, data, and basic data, while also learning about
the IDE, its functions, and some standard rules, such as naming in code. At the same time, it assists
students in learning how to create simple apps.
1.Algorithm
• Characteristics of algorithm:
Input: An algorithm requires some input values. An algorithm can be given a value other than 0 as
input.
Output: At the end of an algorithm, you will have one or more outcomes.
LE PHU BINH 6
BOOK MANAGERMENT SYSTEM
Unambiguity: A perfect algorithm is defined as unambiguous, which means that its instructions
should be clear and straightforward.
Finiteness: An algorithm must be finite. Finiteness in this context means that the algorithm should
have a limited number of instructions, i.e., the instructions should be countable.
Effectiveness: Because each instruction in an algorithm affects the overall process, it should be
adequate.
• Types of algorithm:
LE PHU BINH 7
BOOK MANAGERMENT SYSTEM
1.2 Flowchart
Step 1: START
Step 7: IF grade[I]>grade[j];
Step 8: INCREASE j by 1.
Step 9: INCREASE I by 1.
LE PHU BINH 8
BOOK MANAGERMENT SYSTEM
When we want to develop a program by using any programming language, we have to follow a sequence
of steps. These steps are called phases in program development.
The program development life cycle is a set of steps or phases which are used to develop a program in
any programming language.
Before the team of software technicians can cough up the general idea for any software, it is essential for
the team to gather the business requirements in this very first phase. At this point, the prime focus of the
stakeholders and project managers is to note the exact things needed from any software under
consideration. There are several questions to be asked at this stage, which include:
LE PHU BINH 9
BOOK MANAGERMENT SYSTEM
Once these general questions are answered, a general outline is created for the software developers to
focus on. This data is then analyzed to ensure its validity & any possibility for incorporation of the same.
Lastly, a document for requirement specification is prepared which serves as a guideline for the next level
of the software development process.
2-Design:
This is the next phase for the software development process. In this stage, the draft design is prepared for
the software from the stage-1 requirement specifications. The system designs help in specifying the
hardware as well as system requirements. It also helps with the definition of an overall system in software
architecture.
The design specifications for the system serve as the input for the following phase of the software
development model. In this particular phase, test strategies are developed by the testers by mentioning
things to test and the ways to check it.
3-Coding/Implementation:
After receiving the design documents for the software to be created, the work following the design stage
is divided equally into various units and modules. This is the stage where actual coding begins. The main
focus of the phase is the development of perfect codes by the developers. This particular phase is the
longest in the entire protocol.
4-Testing:
LE PHU BINH 10
BOOK MANAGERMENT SYSTEM
5-
If you want to know what is software development; you can never skip understanding the testing stage.
This particular stage is very crucial for the developers. If anything goes wrong in the testing stage or any
error is noted in the codes, it can lead to the repetition of the coding process, and the cycle goes on till the
completion of the same. In this stage, all variants of the functional testing such as integration testing, unit
testing, system testing, acceptance testing, and non-functional testing are done.
5-Deployment Stage:
After all the errors from coding are removed during the testing stage, the next step is termed as the
deployment stage. The finalized code is implemented into the software and then deployed or delivered to
the customers to be used.
As the product is being given to potential customers, the first thing done to ensure that it works fine on a
large scale is to go with beta testing. If there is any possibility for changes or there are possible bugs
caught during implementation, it is immediately reported to the team that engineers its errors to work fine
in real-time. Once the changes are implemented with all the bugs fixed, the final dispersal or deployment
is set in motion.
6-Maintenance:
Once the customers start using well-developed software, the actual issues start surfacing with time. This
doesn’t mean that the software will get corrupted. However, it might require occasional issues surfacing
time and again. This particular process is termed as maintenance for the finalized product or software.
LE PHU BINH 11
BOOK MANAGERMENT SYSTEM
3. Write a program
LE PHU BINH 12
BOOK MANAGERMENT SYSTEM
1.1 Definition
It is defined as a programming language derived from the structure programming and based on calling
procedures. The procedures are the functions, routines, or subroutines that consist of the computational
steps required to be carried. It follows a step-by-step approach in order to break down a task into a set of
variables and routines via a sequence of instructions.
During the program's execution, a procedure can be called at any point, either by other procedures or by
itself. The examples of procedural programming are ALGOL, COBOL, BASIC, PASCAL, FORTRAN,
and C.
5. Functions change the value of data at any time from any place. (Functions transform data from
one form to another.)
LE PHU BINH 13
BOOK MANAGERMENT SYSTEM
Advantages Disadvantages
The coded simplicity along with ease of The Procedural code is often not reusable,
implementation of compilers and interpreters may pose the need to recreate the cod
needed to use in another application
A large variety of books and online course
material available on tested algorithms, making Difficult to relate with real-world objects
it easier to learn along the way
The importance is given to the operation
The source code is portable, therefore, it can be than the data, which might pose issues in
used to target a different CPU as well data-sensitive cases
The code can be reused in different parts of the The data is exposed to the whole pr
program, without the need to copy it making it not so much security friendly
LE PHU BINH 14
BOOK MANAGERMENT SYSTEM
LE PHU BINH 15
BOOK MANAGERMENT SYSTEM
2. Object-orientated programming(OOP)
2.1 Definition
Object-oriented programming is a computer programming design philosophy or methodology that
organizes/ models software design around data or objects rather than functions and logic. It includes two
words, "object" and "oriented". In a dictionary object is an article or entity that exists in the real world.
The meaning of oriented is interested in a particular kind of thing or entity. In layman's terms, it is a
programming pattern that rounds around an object or entity.
The programming paradigm where everything is represented as an object is known as a truly object-
oriented programming language. Smalltalk is said to be the first truly object-oriented programming
language.
LE PHU BINH 16
BOOK MANAGERMENT SYSTEM
OOP is said to be the most popular programming model among developers. It is well suited for programs
that are large, complex, and actively updated or maintained. It makes the development and maintenance
of software easy by providing major concepts such as abstraction, inheritance, polymorphism, and
encapsulation. These four are also the four pillars of an object-oriented programming system.
OOPs, provide the ability to simulate real-world events much more effectively. We can provide the
solution to real-world problems if we are using the Object-Oriented Programming language. OOPs,
provide data hiding, whereas, in Procedure-oriented programming language, global data can be accessed
from anywhere.
The examples of OOPs are - C#, Python, C++, Java, PHP, Scala, Perl, etc.
1. Objects
Object is a basic unit of Object Oriented Programming and represents the real life entities. A typical Java
program creates many objects, which as you know, interact by invoking methods. An object consists of:
Behavior : It is represented by methods of an object. It also reflects the response of an object with other
objects.
LE PHU BINH 17
BOOK MANAGERMENT SYSTEM
Identity : It gives a unique name to an object and enables one object to interact with other objects.
2. Class
A class is a user defined blueprint or prototype from which objects are created. It represents the set of
properties or methods that are common to all objects of one type. In general, class declarations can
include these components, in order:
Class name: The name should begin with a initial letter (capitalized by convention).
<classname><objectname>;
employee manager;
Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the keyword extends.
A class can only extend (subclass) one parent.
Interfaces(if any): A comma-separated list of interfaces implemented by the class, if any, preceded by the
keyword implements. A class can implement more than one interface.
3.Inheritance
Inheritance is the mechanism by which one class can inherit the properties of another. It allows a
hierarchy of classes to be build, moving from the most general to the most specific. When one class is
inherited by another, the class that is inherited is called the base class. The inheriting class is called the
derived class. In general, the process of inheritance begins with the definition of a base class. The base
class defines all qualities that will be common to any derived class. . In OOPs, the concept of inheritance
provides the idea of reusability. In essence, the base class represent the most general description of a set
of traits. The derived class inherits those general traits and adds properties that are specific to that class.
LE PHU BINH 18
BOOK MANAGERMENT SYSTEM
4.Polymorphism
Polymorphism comes from the Greek words “poly” and “morphism”. “poly” means many and
“morphism” means form i.e.. many forms. Polymorphism means the ability to take more than one form.
For example, an operation have different behavior in different instances. The behavior depends upon the
type of the data used in the operation.
1) Function overloading
2) Operator overloading
It is able to express the operation of addition by a single operater say ‘+’. When this is possible you use
the expression x + y to denote the sum of x and y, for many different types of x and y; integers , float and
complex no. You can even define the + operation for two strings to mean the concatenation of the strings.
LE PHU BINH 19
BOOK MANAGERMENT SYSTEM
5.Abstraction
Abstraction refers to the act of representing essential features without including the back ground details
or explanation. Classes use the concept of abstraction and are defined as a list of attributes such as size,
weight, cost and functions to operate on these attributes. They encapsulate all essential properties of the
object that are to be created. The attributes are called as data members as they hold data and the functions
which operate on these data are called as member functions.
Class use the concept of data abstraction so they are called abstract data type (ADT).
6.Encapsulation
Wrapping of data and functions together as a single unit is known as encapsulation. By default data is not
accessible to outside world and they are only accessible through the functions which are wrapped in a
class. Prevention of data from direct access by the program is called data hiding or information hiding.
LE PHU BINH 20
BOOK MANAGERMENT SYSTEM
Advantages Disadvantages
Class TestStudent
Class Student
LE PHU BINH 21
BOOK MANAGERMENT SYSTEM
LE PHU BINH 22
BOOK MANAGERMENT SYSTEM
1. Definition It is a programming language that is derived from structure Object-oriented programming is a computer
programming and based upon the concept of calling programming design philosophy or
procedures. It follows a step-by-step approach in order to methodology that organizes/ models software
break down a task into a set of variables and routines via a design around data or objects rather than
sequence of instructions. functions and logic.
LE PHU BINH 23
BOOK MANAGERMENT SYSTEM
4. Data In procedural programming, data moves freely within the In OOP, objects can move and communicate
movement system from one function to another. with each other via member functions.
6. Access There are no access modifiers in procedural programming. The access modifiers in OOP are named as
modifiers private, public, and protected.
7. Inheritance Procedural programming does not have the concept of There is a feature of inheritance in object-
inheritance. oriented programming.
8. Code There is no code reusability present in procedural It offers code reusability by using the feature of
reusability programming. inheritance.
9. Overloading Overloading is not possible in procedural programming. In OOP, there is a concept of function
overloading and operator overloading.
10. Importance It gives importance to functions over data. It gives importance to data over functions.
11. Virtual class In procedural programming, there are no virtual classes. In OOP, there is an appearance of virtual
classes in inheritance.
12. Complex It is not appropriate for complex problems. It is appropriate for complex problems.
problems
13. Data hiding There is not any proper way for data hiding. There is a possibility of data hiding.
14. Program In Procedural programming, a program is divided into small In OOP, a program is divided into small parts
division programs that are referred to as functions. that are referred to as objects.
15. Examples Examples of Procedural programming include C, Fortran, Pascal, The examples of object-oriented programming
and VB. are -
.NET, C#, Python, Java, VB.NET, and C++.
4. Event-drive programming
1. Define
Have you ever clicked a link on a web page or a button in an application and nothing happens? It can be
very frustrating when a component doesn't perform as expected. When we develop applications in any
language, it's important that user interaction actually does something.
Whenever you take action on a component, an event occurs. Whether anything happens after that event is
up to you, the programmer, to determine. If you have actions defined for these events, then you have
created an event-driven program or application.
LE PHU BINH 24
BOOK MANAGERMENT SYSTEM
2. Event
An event can be defined as a type of signal to the program that something has happened.
eg. a Timer
If a component can generate an event, any subclass of the component can generate the same type of
event.
The subclasses of EventObject deal with special types of events, such as button actions, window events,
component events, mouse movements, and keystrokes.
LE PHU BINH 25
BOOK MANAGERMENT SYSTEM
Every GUI component can generate MouseEvent, KeyEvent, FocusEvent, and ComponentEvent.
The listener objectʹs class must implement the corresponding event-listener interface.
LE PHU BINH 26
BOOK MANAGERMENT SYSTEM
The subclasses of EventObject deal with special types of events, such as button actions, window events,
component events, mouse movements, and keystrokes.
Every GUI component can generate MouseEvent, KeyEvent, FocusEvent, and ComponentEvent.
The listener objectʹs class must implement the corresponding event-listener interface.
LE PHU BINH 27
BOOK MANAGERMENT SYSTEM
In some applications, you can use an inner class to make programs simple.
An inner class can reference the data and methods defined in the outer class in which it nests, so you do
not need to pass the reference of the outer class to the constructor of the inner class.
Inner Class can access private instance variables in the enclosing object.
LE PHU BINH 28
BOOK MANAGERMENT SYSTEM
A listener class is designed specifically to create a listener object for a GUI component (e.g., a button).
So, it is appropriate to define the listener class inside the frame class as an inner class.
An anonymous inner class must implement all the abstract methods in the superclass or in the
interface.
It combines declaring an inner class and creating an instance of the class in one step.
The interface ActionListener should be implemented to listen for a button action event.
window opened,
LE PHU BINH 29
BOOK MANAGERMENT SYSTEM
closing,
closed,
activated,
deactivated,
iconified, and
deiconified.
Java provides two listener interfaces, MouseListener and MouseMotionListener, to handle mouse events.
pressed,
released,
entered,
exited, or
clicked.
dragging or
getKeyChar()
LE PHU BINH 30
BOOK MANAGERMENT SYSTEM
getKeyCode()
Key Constants
Advantages Disadvantages
1. Flexibility 1. Complex
Programmers that use event-driven can be altered For simple programs, event-driven programming is
easily if the programmer wants something to be often more complex and cumbersome than batch
changed. This paradigm allows the programmer to programming.
produce a form of their requirements.
2. Less Logical and Obvious
Programmers who are event-driven can be put
together without too many problems and also the The flow of the program is usually less logical and
code and design can be easily altered because if obvious
something isn't right. 3. Difficult to find Error
2. Suitability for Graphical Interfaces Errors can be more difficult to spot than with
Event-driven allows the user to select different simpler, procedural programs.
LE PHU BINH 31
BOOK MANAGERMENT SYSTEM
5. Highly Compostable
It is highly compostable.
LE PHU BINH 32
BOOK MANAGERMENT SYSTEM
A set of functions that handle events. Depending on the implementation these can be blocking or
non-blocking.
The main loop (or loops, if you are brave) which constantly polls for new events and calls the
matching event handler(s) when a registered event is received.
Object oriented programming is a way of organizing code around the principles of encapsulation,
inheritance, substitution, programming to interfaces, and so on. Object oriented programs are usually
mostly procedural.
Event based programming is about writing event handling procedures and having the core event loop
provided by the underlying system. In this way you can save the trouble of writing your own event loop
and benefit from various libraries that already work with the system provided event loop. Event based
programs are very often writing using object oriented style, but not always.
These three categories are thus not related strictly hierarchically, but in common usage they are mostly
nested within one another.
LE PHU BINH 33
BOOK MANAGERMENT SYSTEM
2. In OOP with EDP all OOP principles (encapsulation, inheritance and polymorphism) stay intact.
3. In OOP with EDP objects acquire some mechanism of publishing event notifications and
subscribing to event notifications from other objects.
4. The difference between OOP with / without EDP is control flow between objects.
In OOP without EDP control moves from one object to another object on a method call.
Object mainly invokes methods of other objects.
In OOP with EDP control moves from one object to another object on event notification.
Object subscribes on notifications from other objects, then waits for notifications from the
objects it is subscribed on, does some work based on notification and publishes it's own
notifications.
5. Conclusion: OOP+EDP is "exactly our old friend OOP" with control flow inverted thanks to
Event-Driven Design.
But it is an Event drive programming, easy to develop applications. VB is used to Develop Graphical
User Interface Applications (GUIs).
1. General introduction
Design a Library Management System
A Library Management System is a software built to handle the primary housekeeping functions of a
library. Libraries rely on library management systems to manage asset collections as well as relationships
LE PHU BINH 34
BOOK MANAGERMENT SYSTEM
with their members. Library management systems help libraries keep track of the books and their
checkouts, as well as members’ subscriptions and profiles.
Library management systems also involve maintaining the database for entering new books and recording
books that have been borrowed with their respective due dates.
2. System Requirements
We will focus on the following set of requirements while designing the Library Management System:
1. Any library member should be able to search books by their title, author, subject category as well
by the publication date.
2. Each book will have a unique identification number and other details including a rack number
which will help to physically locate the book.
3. There could be more than one copy of a book, and library members should be able to check-out
and reserve any copy. We will call each copy of a book, a book item.
4. The system should be able to retrieve information like who took a particular book or what are the
books checked-out by a specific library member.
5. There should be a maximum limit (5) on how many books a member can check-out.
6. There should be a maximum limit (10) on how many days a member can keep a book.
7. The system should be able to collect fines for books returned after the due date.
8. Members should be able to reserve books that are not currently available.
9. The system should be able to send notifications whenever the reserved books become available, as
well as when the book is not returned within the due date.
10. Each book and member card will have a unique barcode. The system will be able to read barcodes
from books and members’ library cards.
3. Diagram
We have three main actors in our system:
Librarian: Mainly responsible for adding and modifying books, book items, and users. The
Librarian can also issue, reserve, and return book items.
Member: All members can search the catalog, as well as check-out, reserve, renew, and return a
book.
System: Mainly responsible for sending notifications for overdue books, canceled reservations,
etc.
Here are the top use cases of the Library Management System:
LE PHU BINH 35
BOOK MANAGERMENT SYSTEM
Register new account/cancel membership: To add a new member or cancel the membership of an
existing member.
Return a book: To return a book to the library which was issued to a member.
LE PHU BINH 36
BOOK MANAGERMENT SYSTEM
4. Code
Here is the code for the use cases mentioned above:
1.Check-out a book,
3.Renew a book.
LE PHU BINH 37
BOOK MANAGERMENT SYSTEM
Note: This code only focuses on the design part of the use cases. Since you are not required to write a
fully executable code in an interview, you can assume parts of the code to interact with the database,
payment system, etc.
LE PHU BINH 38
BOOK MANAGERMENT SYSTEM
Database :
These classes represent various people that interact with our system:
LE PHU BINH 39
BOOK MANAGERMENT SYSTEM
LE PHU BINH 40
BOOK MANAGERMENT SYSTEM
LE PHU BINH 41
BOOK MANAGERMENT SYSTEM
LE PHU BINH 42
BOOK MANAGERMENT SYSTEM
BookGUI
BookReservation, BookLending, and Fine: These classes represent a book reservation, lending, and fine
collection, respectively.
LE PHU BINH 43
BOOK MANAGERMENT SYSTEM
LE PHU BINH 44
BOOK MANAGERMENT SYSTEM
LE PHU BINH 45
BOOK MANAGERMENT SYSTEM
LE PHU BINH 46
BOOK MANAGERMENT SYSTEM
1. Test
Input
Login
I have created this function to enable the user and the admin login. So, initially when a user logs in for the
first time, that user will be an admin by default, and the username and password will be {admin, admin}.
Refer below.
LE PHU BINH 47
BOOK MANAGERMENT SYSTEM
For this schema, I have considered only one admin. So, once a user logs in as an admin, he or she will be
redirected to the admin menu as below. I will discuss the functions of the admin in the admin
menu section.
Connect
The connect function is used to connect the database to the GUI.
Create
The create function is used to create the database, tables and add data into these tables. So, to do that,
statements will be used.
Now, that we have created the database, connected with GUI and enables the login function, next in this
article on Library Management System Project in Java, let us now discuss the functions of the User
Menu.
User Menu
The User Menu is designed to show details of all the books present in the library and the books issued by
the user.
Admin Menu
The Admin Menu is designed to show details of users, books, issued books, add books, return books, add
user, and create or reset the database.
Now that you have understood all the functions, let us execute our library management system project in
Java and see the outputs.
Output
Execute the application by clicking on the run button. Once, you execute you will see the below dialog
box. In the below dialog box, mention username and password as {admin, admin}. Then click on the
Login button.
LE PHU BINH 48
BOOK MANAGERMENT SYSTEM
Once you click on the Login button, you will see the below dialog box opening up.
Here you have various options which you can explore. So, let us start with the first one:
View book
Once, you click on View Books button, you will see the below frame displaying all the books present in
the database, with their details.
View User
The View Users button is used to view the current users on the system. Since we just have only one user
present i.e the admin, it will show you output as below:
LE PHU BINH 49
BOOK MANAGERMENT SYSTEM
Create/Reset
This functionality is used to create or reset a database. So, once you click on the button Create/Rest, you
will see the below output:
Add User
To add a user, click on the option “Add User” and mention details such as username, password and
choose the radio button user or admin. By default, it will be the user. Then, click on Create.
LE PHU BINH 50
BOOK MANAGERMENT SYSTEM
Now, again if you click on View Users button, you will see the below output:
Alright, so now that we have added a user. Let us say, that particular user wants to issue books. To do
that, the user has to choose the option of Issue Book.
Issue Book
Suppose, if you are the user, once you click on the Issue Book button, you have to mention the Book ID,
User ID, Period(Number of days for issuing the book), and the Issue Date as follows:
LE PHU BINH 51
BOOK MANAGERMENT SYSTEM
Then click on Submit. Once, you click on Submit, you will see the below dialog box:
Now, if you want to see the issued books details, you can use the View Issued Books functionality.
Alright, so, now if the user logs in to the system, using the login function, as below:
LE PHU BINH 52
BOOK MANAGERMENT SYSTEM
Here, the user can view all the books in the database by using the View Books option and the books
issued by the user in the My Books section as below:
Now, if you wish to return the book, then you have to choose the option of Return Book.
Return Book
Once, you click on the Return Book, mention the Issue ID and the return date as below. Then click
on Return.
LE PHU BINH 53
BOOK MANAGERMENT SYSTEM
After that, you again see a dialog box, showing the message “Book Returned“. Refer below.
Now, if you click on the View Issued Books, you will see the below output:
Lastly, if you wish to add a book, you can use the option of Add Book.
Add Book
Click on the Add Book button, and mention the book name, genre and price. Then, click on
the Submit button. Refer below.
LE PHU BINH 54
BOOK MANAGERMENT SYSTEM
Apart from this, you can also, see the added books in the View Books section as below:
1. Debugging
1.1 Definition
Debugging is the process of detecting and removing of existing and potential errors (also called as ‘bugs’)
in a software code that can cause it to behave unexpectedly or crash. To prevent incorrect operation of a
LE PHU BINH 55
BOOK MANAGERMENT SYSTEM
software or system, debugging is used to find and resolve bugs or defects. When various subsystems or
modules are tightly coupled, debugging becomes harder as any change in one module may cause more
bugs to appear in another. Sometimes it takes more time to debug a program than to code it.
1.2 Description
To debug a program, user has to start with a problem, isolate the source code of the problem, and then fix
it. A user of a program must know how to fix the problem as knowledge about problem analysis is
expected. When the bug is fixed, then the software is ready to use. Debugging tools (called debuggers)
are used to identify coding errors at various development stages. They are used to reproduce the
conditions in which error has occurred, then examine the program state at that time and locate the cause.
Programmers can trace the program execution step-by-step by evaluating the value of variables and stop
the execution wherever required to get the value of variables or reset the program variables. Some
programming language packages provide a debugger for checking the code for errors while it is being
written at run time.
EXAMPLE:
A Java program can be debugged simply by right clicking on the Java editor class file from Package
explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead.
LE PHU BINH 56
BOOK MANAGERMENT SYSTEM
Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java
application.
Breakpoints
A breakpoint is a signal that tells the debugger to temporarily suspend execution of your program at a
certain point in the code.
To define a breakpoint in your source code, right-click in the left margin in the Java editor and
select Toggle Breakpoint. Alternatively, you can double-click on this position.
LE PHU BINH 57
BOOK MANAGERMENT SYSTEM
The Breakpoints view allows you to delete and deactivate Breakpoints and modify their properties.
All breakpoints can be enabled/disabled using Skip All Breakpoints. Breakpoints can also be
imported/exported to and from a workspace
Debug Perspective
The debug perspective offers additional views that can be used to troubleshoot an application like
Breakpoints, Variables, Debug, Console etc. When a Java program is started in the debug mode, users are
prompted to switch to the debug perspective.
LE PHU BINH 58
BOOK MANAGERMENT SYSTEM
Display view – Allows to Inspect the value of a variable, expression or selected text during
debugging.
Stepping commands
LE PHU BINH 59
BOOK MANAGERMENT SYSTEM
Backwards analysis of the problem which involves tracing the program backward from the location
of failure message in order to identify the region of faulty code. A detailed study of the region is
conducting to find the cause of defects.
Forward analysis of the program involves tracing the program forwards using breakpoints or print
statements at different points in the program and studying the results. The region where the wrong
outputs are obtained is the region that needs to be focused to find the defect.
Using the past experience of the software debug the software with similar problems in nature. The
success of this approach depends on the expertise of the debugger.
Radare2
WinDbg
Valgrind
LE PHU BINH 60
BOOK MANAGERMENT SYSTEM
Good software development organizations want their programmers to maintain to some well-defined and
standard style of coding called coding standards. They usually make their own coding standards and
guidelines depending on what suits their organization best and based on the types of software they
develop. It is very important for the programmers to maintain the coding standards otherwise the code
will be rejected during code review.
A coding standard gives a uniform appearance to the codes written by different engineers.
It improves readability, and maintainability of the code and it reduces complexity also.
Modification history
Different functions supported in the module along with their input output parameters
3. Naming conventions for local variables, global variables, constants and functions:
Some of the naming conventions are given below:
Meaningful and understandable variables name helps anyone to understand the reason of using it.
LE PHU BINH 61
BOOK MANAGERMENT SYSTEM
Local variables should be named using camel case lettering starting with small letter (e.g. localData)
whereas Global variables names should start with a capital letter (e.g. GlobalData). Constant
names should be formed using capital letters only (e.g. CONSDATA).
The names of the function should be written in camel case starting with small letters.
The name of the function must describe the reason of using the function clearly and briefly.
4. Indentation:
Proper indentation is very important to increase the readability of the code. For making the code readable,
programmers should use White spaces properly. Some of the spacing conventions are given below:
There must be a space after giving a comma between two function arguments.
Proper Indentation should be there at the beginning and at the end of each block in the program.
All braces should start from a new line and the code following the end of braces also start from a new
line.
On the other hand, Coding guidelines give some general suggestions regarding the coding style that to be
followed for the betterment of understandability and readability of the code. Some of the coding
guidelines are given below :
LE PHU BINH 62
BOOK MANAGERMENT SYSTEM
Coding guidelines increase the efficiency of the software and reduces the development time.
Coding guidelines help in detecting errors in the early phases, so it helps to reduce the extra cost incurred
by the software project.
If coding guidelines are maintained properly, then the software code increases readability and
understandability thus it reduces the complexity of the code.
Referance
1.Difference between procedural programming and object-oriented programming(
https://www.javatpoint.com/procedural-programming-vs-object-oriented-programming )
2.What are the steps taken from writing code to execution? (https://www.quora.com/What-are-the-steps-
taken-from-writing-code-to-execution)
( https://www.geeksforgeeks.org/object-oriented-programming-oops-concept-in-java )
LE PHU BINH 63
BOOK MANAGERMENT SYSTEM
LE PHU BINH 64