IP Presentation

Download as odp, pdf, or txt
Download as odp, pdf, or txt
You are on page 1of 24

INFORMATICS

PRACTICES
Prepared by : Priyani Mondal
Class : XII Science
PROJECT FILE
Acknowledgment
I would like to express my sincere gratitude to all those
who helped me complete this project successfully. I would
like to thank my class teacher, for their constant support,
valuable guidance and encouragement throughout the
process. I would also like to extend my thanks to our school
principal, for providing all the necessary facilities required
for this project. Finally, I would like to thank my family who
motivated me and boosted my morale when I was stressed.
Content
■Problem-Solution Project Scope
Requirements : Software &
Hardware Table Structure
Python Code
■Output Bibliography
Problem-Solution
Problem: Manually tracking student attendance is
time-consuming and error-prone. Solution: Create
a digital attendance system where teachers can
mark students present or absent. The system can
generate attendance summaries, such as
monthly attendance rates, absences by student,
and alerts for students with low attendance.
Project Scope
This project will be a digital attendance
management system for a school that allows
teachers to record, update, and analyze
student attendance efficiently. The system
will: • Enable easy attendance tracking for
each class. • Provide detailed attendance
summaries and reports. • Help identify
students with attendance issues. • Be
accessible through a simple user interface
for easy use by teachers.
Hardware Requirements
• Processor: Intel i3 or equivalent (minimum) for smooth
operation. Faster processors will improve performance.
• RAM: At least 4GB of RAM is recommended for efficient
multitasking with Python and MySQL. • At least 500MB
free space for Python, MySQL, and other dependencies. •
Additional space for MySQL database storage if the
attendance data grows over time. • Network: If the
project requires remote access to the MySQL database, a
stable internet connection is needed.
Software
Requirements
• Operating System: Windows, macOS,
or Linux. • Programming Language:
Python. • Database: MySQL or SQLite
for managing student and attendance
data. • Python Libraries: mysql-
connector-python (or sqlite3) for
database interaction.
Table
Structure
import mysql.connector # Establish connection
connection =

Pytho
mysql.connector.connect( host=‘localhost’, #
replace with your host if needed user=‘priyani’, #
replace with your MySQL username
password=‘Priyani@2025’, # replace with your

n
MySQL password database=‘attendance_system’ )
# Check if connection is successful if
connection.is_connected(): print(“Connection
successful!”) else: print(“Failed to connect.”) #
Close the connection connection.close()

Code
Cursor = db.cursor() def add_student(name): “””Add a new student to the
database.””” query = “INSERT INTO students (name) VALUES (%s)”
cursor.execute(query, (name,)) db.commit() print(f”Student ‘{name}’ added
successfully.”)

def mark_attendance(student_id, status): “””Mark attendance for a student.”””


date = datetime.today().date() query = “INSERT INTO attendance
(student_id, date, status) VALUES (%s, %s, %s)” cursor.execute(query,
(student_id, date, status)) db.commit() print(f”Attendance marked for
student ID {student_id} as ‘{status}’.”)
Def view_attendance(): “””View attendance records.””” query = “””
SELECT students.name, attendance.date, attendance.status FROM
attendance JOIN students ON attendance.student_id =
students.student_id ORDER BY attendance.date DESC “””
cursor.execute(query) records = cursor.fetchall() print(“Attendance
Records:”) for record in records: print(f”Student: {record[0]}, Date:
{record[1]}, Status: {record[2]}”)
# Main Menu while True: print(“\n1. Add Student”) print(“2. Mark
Attendance”) print(“3. View Attendance”) print(“4. Exit”) choice =
input(“Enter your choice: “) if choice == “1”: name = input(“Enter
student name: “) add_student(name) elif choice == “2”:
student_id = int(input(“Enter student ID: “)) status = input(“Enter
status (Present/Absent): “) mark_attendance(student_id, status)
elif choice == “3”: view_attendance() elif choice ==
“4”: break else: print(“Invalid choice. Please try
again.”) # Close the database connection cursor.close()
db.close()
1.

from datetime import date


def mark_attendance(student_id, status, class_section):
cursor = connection.cursor() query = “INSERT INTO
Attendance (StudentID, Date, Status, ClassSection) VALUES
(%s, %s, %s, %s)” data = (student_id, date.today(), status,
class_section) cursor.execute(query, data)
connection.commit() print(“Attendance marked
successfully.”)
Explanation
1) Database Connection: Connects to MySQL using
mysql.connector. 2) Functions: add_student(): Adds a new
student to the students table. Mark_attendance(): Adds an
attendance record to the attendance table.
View_attendance(): Retrieves and displays all attendance
records.
3) Main Menu: A simple menu to interact with the system,
allowing the user to add students, mark attendance, view
records, or exit.
Output
Marking
Attendance for
Students Let’s
mark
attendance for
these students
for a particular
date (e.g.,
2024-11-06).
Let’s assume:
Marking Attendance for
Another Day If you want
to mark attendance for
the next day (e.g., 2024-
11-07) with different
statuses, here’s how it
could look. Input:
This output gives a history of attendance
for each student across multiple days.
This is not only
efficient but easier
to find details as
well.
I am sure in future
attendance would
Bibliography
Google
https://www.who.int
https://en.m.wikipedia.org

You might also like