Cs Practical 1
Cs Practical 1
ACADEMIC YEAR:2024-25
PROJECT FILE
NAME: NISHA MEENA
ROLL NUMBER: 22
CLASS: XII-A
SUBJECT: COMPUTER SCIENCE
SUBJECT CODE:
PROJECT GUIDE: Mr. RANJEET PRASAD
PGT COMPUTER SCIENCE
KENDRIYA VIDYALAYA JANAKPURI
NEW DELHI
CERTIFICATE
This is to certify that NISHA MEENA, a student of class
XII-A has successfully completed the research on the
below mentioned project under the guidance of MR.
RANJEET PRASAD (pgt-computer science) during the
year 2024-25 in partial fulfillment of physics practical
examination.
2. Introduction
3. Objectives of project
4. Proposed system
5. Hardware and software required
6. Flow chart
7. Source code
8. Output
9. Bibliography
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project
depends largely on the encouragement and guidelines of many
others. I take this opportunity to express my gratitude to the
people who have been instrumental in the successful
completion of this project.
I express my deep sense of gratitude to the luminary The
Principal who has been continuously motivating and extending
their helping hand to us.
I express my sincere thanks to the academician the Vice
Principal, for constant encouragement and the guidance
provided during this project.
I am overwhelmed to express my thanks to The Administrative
Officer for providing me an infrastructure and moral support
while carrying out this project in the school.
My sincere thanks to Ms. Kamini Singhal, Master In-charge, a
guide, mentor, and above all, a friend, who critically reviewed
my project and helped in solving each and every problem that
occurred during the implementation of the project.
The guidance and support received from all the members who
contributed and are contributing to this project were vital for
the success of the project. I am grateful for their constant
support and help.
INTRODUCTION
This project focuses on developing a user-friendly software
solution for managing library operations. The aim is to provide
bookstall owners with a tool that simplifies daily tasks like
managing inventory, processing customer transactions, and
tracking sales. The system enables features such as adding
new stock, updating existing records, and generating receipts.
Additionally, it includes a sales graph to visualize monthly
performance, giving valuable insights for better decision-
making.
OBJECTIVES OF THE PROJECT
The goal of this project is to integrate theoretical knowledge
with practical application, demonstrating how programming
skills can address everyday challenges. It highlights the
potential of software development to streamline processes and
create impactful solutions.
1. Learn to use modern programming tools to create
functional software.
2. Practice object-oriented principles to build scalable and
maintainable programs.
3. Write structured and efficient code to solve specific
problems.
4. Build a strong foundation in essential computer science
concepts, including systems, algorithms, and software
design.
5. Take on real-world projects to develop research and
presentation skills in line with academic and professional
standards.
6. Develop practical problem-solving abilities by addressing
real-life scenarios.
7. Understand how software can improve workflow efficiency
and provide data-driven insights for better management.
PROPOSED SYSTEM
Hardware Requirements
1. Processor: Intel Core i3 or higher.
2. RAM: Minimum 4 GB.
3. Storage: At least 20 GB of free disk space.
4. Monitor: Any standard display for user interface.
5. Input Devices: Keyboard and mouse.
6. Printer (optional): For generating hard copies of reports.
Software Requirements
1. Operating System: Windows, macOS, or Linux.
2. Programming Language: Python/Java/C++ (choose one
based on your implementation).
3. Database Management System: MySQL or SQLite.
4. Text Editor/IDE:
o VS Code / PyCharm for Python
o Eclipse / IntelliJ IDEA for Java.
o Code::Blocks / Dev C++ for C++.
5. Additional Libraries/Modules (if using Python):
o tkinter or PyQt for GUI.
o pandas for file handling (CSV).
o mysql-connector for database connectivity.
Flowchart
Source code
import mysql.connector
class Library:
def __init__(self, db_config):
self.connection = mysql.connector.connect(**db_config)
self.cursor = self.connection.cursor()
self.create_table()
def create_table(self):
self.cursor.execute("""
CREATE TABLE IF NOT EXISTS books (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE,
status ENUM('available', 'issued') DEFAULT 'available' )""")
self.connection.commit()
def display_books(self):
self.cursor.execute("SELECT name, status FROM books")
books = self.cursor.fetchall()
print("\nAvailable Books:")
for book, status in books:
status_label = " (Issued)" if status == "issued" else ""
print(f" - {book}{status_label}")
def issue_book(self, book_name):
self.cursor.execute("SELECT status FROM books WHERE name = %s",
(book_name,))
result = self.cursor.fetchone()
if result:
if result[0] == "available":
self.cursor.execute("UPDATE books SET status = 'issued' WHERE name
= %s", (book_name,))
self.connection.commit()
print(f"\n'{book_name}' has been issued to you.")
else:
print(f"\nSorry, '{book_name}' is already issued.")
else:
print(f"\nSorry, '{book_name}' is not available in the library.")
def close_connection(self):
self.cursor.close()
self.connection.close()
def main():
db_config = {
"host": "localhost",
"user": "root",
"password": "student12", # Replace with your MySQL password
"database": "LibraryDB" # Replace with your database name
}
library = Library(db_config)
while True:
print("\n=== Library Management System ===")
print("1. Display Books")
print("2. Issue a Book")
print("3. Return a Book")
print("4. Add a Book")
print("5. Exit")
try:
choice = int(input("\nEnter your choice: "))
if choice == 1:
library.display_books()
elif choice == 2:
book_name = input("Enter the name of the book you want to issue: ")
library.issue_book(book_name)
elif choice == 3:
book_name = input("Enter the name of the book you want to
return:")
library.return_book(book_name)
elif choice == 4:
book_name = input("Enter the name of the book you want to add: ")
library.add_book(book_name)
elif choice == 5:
print("\nThank you for using the Library Management System!")
break
else:
print("\nInvalid choice. Please choose again.")
except ValueError:
print("\nInvalid input. Please enter a number.")
library.close_connection()
if __name__ == "__main__":
main()
OUTPUT:
PYTHON:
mysql:
Bibliography