Java Library Management System Code
Java Library Management System Code
A Book class that inherits from the Document class and accepts:
o the attribute:
. private int numberOfPages
o and the methods:
. public Livre(Document d,int nombredepages) constructor that allows initialization
an object of type Book.
. public int getNumberOfPages()returns the number of pages in a book.
. public void setNumberOfPages(int numberOfPages)allows assigning a value
in the number of pages.
. public void description()allows you to display the book description.
An abstract class Multimediaand which admits:
o The attribute:
. protected float duration
o and the methods:
. public Multimedia(Document d, float duration)constructor that allows initialization
the multimedia object.
. public float getDuration()returns the duration of a multimedia document.
. public void setDuration(float duration)allows assigning a value to the duration attribute.
. public void description()allows displaying the multimedia description.
A DVD class that inherits from the Multimedia class and that admits:
o The attribute:
. private boolean bonus
o and the methods:
. public DVD(Multimedia m, boolean bonus)constructor that allows initialization
the DVD object.
Annotation :
. public boolean getBonus()returns the bonus value
protected
private . public void setBonus(boolean bonus)method for assigning a value
public to the bonus attribute.
. public void description()allows you to display the DVD description.
A CD class that inherits from the Multimedia class and allows:
Work requested o The attribute:
. private int numberOfBeaches
1. Create all the classes that are in the class diagram. o and the methods:
A DocumentClass: an abstract class whose: . public CD(Multimedia m, int numberOfTracks)constructor that allows
o its attributes are: to initialize the DVD object.
. protected String author
. protected String titre
. public int getNumberOfBeaches()returns the number of beaches
. protected int reference . public void setNumberOfBeaches(int numberOfBeaches)allows assigning a
o its methods are: value to the attribute numberofbeaches.
. public Document(String author, String title, int reference) allows
: . public void description()allows displaying the CD description.
d’initialiser l’objet.
. public String getAuthor()Return the author of the document.
Créer la classeBibliothequequi permet de gérer des documents et dont :
o the attributes are:
. private Document document[]
. private int numberofdocuments
o and the methods:
. public Library(Document documents[])allows to initialize the documents of
the library.
. public int getNumberOfDocuments() r:eturns the number of documents in the
library.
. public Document[] getDocuments()return all the documents from the library
. public void setDocument(Document documents[])allows to assign an array of
documents.
. public void getDocuments()returns the documents to the library.
. public void AddDocument(Document d)allows you to add a document in
a library
. public void RemoveDocument(Document d)allows you to delete a document from
the library. However, the list of the library's documents must be
compressed by making a shift.
. public void ListDocuments()allows displaying all the documents of the
library.
. public boolean FindDocument(Document d)allows you to search for a document
in a library and send back true if it exists and false otherwise.
. public static void main(String args[])main program that allows to:
Create the main menu of your library to match the display above.
underneath:
- Créer une bibliothèque qui comporte 20 documents de différents
types (CD, DVD, and Book). Therefore, the entry must be done via keyboard
using the class: "[Link]» ;
- Remove two documents.
- Search for a document;
- Display the list of all documents in the library.
Note: To terminate an object, you need to redefine the finalize() method which inherits from the Object class.
The file that will contain your compressed project must have your name, first name, and class (e.g.:
Good job