Skip to content

shrutinigam11/Library-Management-System-in-Java

Repository files navigation

Library-Management-System-in-Java

Mini project completed as part of the OOPS with Java course in the 3rd year of my undergrad.

Index

  1. Project Structure
  2. Object-Oriented Programming (OOP) Concepts Utilized
  3. Description
  4. How to Run
  5. Usage
  6. Note

Project Structure

Object-Oriented Programming (OOP) Concepts Utilized

  1. Encapsulation

    • Each class (Book, Patron, Transaction, Library) encapsulates its properties and provides methods to interact with them.
  2. Inheritance

    • No explicit inheritance is used in this project, as the focus is on composition and simplicity.
  3. Polymorphism

    • The toString() method is overridden in each class, providing a polymorphic behavior for displaying object information.

Description

The Library Management System includes classes for Book, Patron, Transaction, and Library. The main class, LibraryManagementSystem, provides a menu-driven interface for users to interact with the library system. Users can display available books, patrons, transaction history, lend books, return books, add new books, and add new patrons.

The system initializes with some sample books and patrons. Books can be lent to patrons, and returned books are recorded in the transaction history.

How to Run

Prerequisites

  • Java Development Kit (JDK) installed
  • Java IDE (optional, but recommended)

Steps (Command Line - Windows)

  1. Clone the Repository:

    git clone https://github.com/shrutin567/Library-Management-System-Java.git
  2. Navigate to the Project Directory:

    cd Library-Management-System-Java
  3. Compile the Java Files:

    javac LibraryManagementSystem.java
  4. Run the Program:

    java LibraryManagementSystem

Steps (Eclipse - Windows)

  1. Open Eclipse:

    • Launch Eclipse IDE.
  2. Import Project:

    • Click on File -> Import.
    • Select General -> Existing Projects into Workspace.
    • Choose the root directory as the cloned project.
  3. Run the Program:

    • Right-click on LibraryManagementSystem.java.
    • Select Run As -> Java Application.
  4. Interact with the Program:

    • The program's menu-driven interface will be displayed in the Eclipse Console.

Steps (Ubuntu)

To run the Library Management System on Ubuntu, follow these instructions:

Prerequisites:

  • Java Development Kit (JDK) installed
  • Git (to clone the repository)
  • Terminal for command-line operations

Steps:

  1. Clone the Repository: Open a terminal and run the following command to clone the repository:

    git clone https://github.com/shrutin567/Library-Management-System-Java.git
  2. Navigate to the Project Directory: Change into the project directory:

    cd Library-Management-System-Java
  3. Compile the Java Files: Compile the Java source files using the following command:

    javac LibraryManagementSystem.java
  4. Run the Program: Run the compiled program:

    java LibraryManagementSystem
  5. Interact with the Program:

    • The program's menu-driven interface will be displayed in the terminal.
    • Enter the corresponding number to perform the desired action.
    • Follow the prompts to input necessary information (e.g., Patron ID, Book ISBN, Date) for lending, returning, adding books, or adding patrons.
    • View available books, patrons, and transaction history through the menu options.
    • Exit the system by choosing the "8. Exit" option in the menu.

Additional Notes:

  • If you encounter any issues related to Java not being installed, you can install OpenJDK using the following command:

    sudo apt-get update
    sudo apt-get install openjdk-11-jdk
  • If you prefer to use an Integrated Development Environment (IDE) like Eclipse on Ubuntu, you can install Eclipse through the Ubuntu Software Center or by running:

    sudo snap install --classic eclipse

    Then, import the project into Eclipse and run the LibraryManagementSystem class.

Usage

  • Upon running the program, a menu will be displayed with various options.
  • Enter the corresponding number to perform the desired action.
  • Follow the prompts to input necessary information (e.g., Patron ID, Book ISBN, Date) for lending, returning, adding books, or adding patrons.
  • View available books, patrons, and transaction history through the menu options.
  • Exit the system by choosing the "8. Exit" option in the menu.

Note

This is a console-based application designed for educational purposes, demonstrating basic OOP concepts in Java. It can be extended for more features and enhanced functionality.

About

Mini project completed as part of the OOPS with Java course in the 3rd year of my undergrad.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages