Skip to content

adhamdr1/Library-Management-System

Repository files navigation

Library Management System

Overview

The Library Management System is a console application written in C# for managing books and users in a library. The system supports two types of users: Librarians and regular users.

Key Features

For Librarians:

  • Add new books to the library
  • Remove books from the library
  • Display available books list

For Regular Users:

  • Borrow books
  • Display available books list

Project Structure

Library Management System/
├── Program.cs              # Main application entry point
├── Library.cs              # Main library class
├── Book.cs                 # Book class
├── User.cs                 # Base user class
├── Librarian.cs            # Librarian class
├── LibraryUser.cs          # Regular user class
├── LibraryCard.cs          # Library card class
└── Properties/
    └── AssemblyInfo.cs     # Assembly information

Classes and Functions

Book Class

public class Book
{
    public int Year;        // Publication year
    public string Title;    // Book title
    public string Author;   // Author name
}

Library Class

  • AddBook(Book book) - Add a new book
  • RemoveBook(Book book) - Remove a book
  • Display() - Display books list
  • BorrowBook(Book book) - Borrow a book

User Classes

  • User (Abstract): Base class for all users
  • Librarian: Inherits from User, can add and remove books
  • LibraryUser: Inherits from User, can borrow books

How to Run

Requirements

  • .NET Framework 4.7.2 or later
  • Visual Studio or any C# development environment

Running Steps

  1. Open the project in Visual Studio
  2. Press F5 or click "Start Debugging"
  3. Choose user type:
    • L for Librarian
    • R for Regular user

Usage Example

For Librarian:

Welcome to the Library System
Are you Librarian or regular user? (L / R)?
L
Welcome Librarian, Enter your Name -> John
Welcome John
Please choose to Add Book (A) / Remove Book (R) / Display Books (D)?
A
Enter Book Details Adding
=============================
Enter Title Book -> Introduction to Programming
Enter Author Book -> John Smith
Enter Year Book -> 2023
Book Add Successfully :)

For Regular User:

Welcome to the Library System
Are you Librarian or regular user? (L / R)?
R
Welcome User, Enter your Name -> Sarah
Welcome Sarah
Please choose to Borrow Book(B) / Display Books (D)?
B
Enter Book Borrow Details
=============================
Enter Title Book -> Introduction to Programming
Enter Author Book -> John Smith
Enter Year Book -> 2023
Book Borrow Successfully :)

Important Files

  • Program.cs: Contains the main interface and core application logic
  • Library.cs: Manages the book collection and operations (add, remove, borrow)
  • Book.cs: Represents a book object with its basic properties

Future Development

The system can be enhanced by adding:

  • Database for data persistence
  • Graphical User Interface (GUI)
  • Secure login system
  • Due date tracking for borrowed books
  • Notification system for overdue books
  • Detailed reports on library activity

Contributing

This is an educational project that can be used as a foundation for developing a more advanced library management system.

License

This project is open source and available for educational and development use.

About

OOP In C#

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages