PROJECT
REPORT
COMPUTER
SCIENCE
-NAKSH YEDKE
CLASS: XI A
ROLL NO: 31
OBJECTIVE
The aim is to create a Python program that
manages attendance for students in a school. The
code achieves this by de ning two classes:
`Student` and `AttendanceSystem`.
1. **Student Class**: This class represents a
student and stores their name, roll number, class,
and attendance record.
2. **AttendanceSystem Class**: This class
manages a collection of students and provides
methods to add students, mark attendance for
each student, and retrieve detailed information
about a student including their attendance record.
The overall aim is to provide a exible and e cient
system for tracking student attendance, which can
be useful for teachers and administrators in
schools to monitor student participation and
engagement.
fi
fl
ffi
DOCUMENTATION
Student Class:
Description: Represents a student in the school
system.
• Attributes:
1. name (str): The name of the student.
2. roll_number (str): The roll number of the
student.
3. student_class (str): The class in which the
student is enrolled.
4. attendance (dict): A dictionary to store the
attendance record of the student.
• Methods:
mark_attendance(date, status): Marks the
attendance of the student for a speci c date.
fi
Attendance System Class:
• Description: Manages the attendance records
of all students.
• Attributes:
students (dict): A dictionary to store student
objects indexed by their names.
Methods:
1. add_student(name, roll_number,
student_class): Adds a new student to the
attendance system.
2. mark_attendance(student_name, date, status):
Marks the attendance of a student for a speci c
date.
3. get_student_details(student_name): Retrieves
details of a student including their attendance
record.
Example Usage:
1. Initialise the Attendance System object.
fi
2. Add students using the add_student method.
3. Mark attendance for students using the
mark_attendance method.
4. Retrieve student details and attendance
records using the get_student_details method.
This documentation provides an overview of the
classes, their attributes, methods, and usage,
helping users understand how to interact with
the provided code e ectively.
ff
PROGRAM
class Student:
def __init__(self, name):
[Link] = name
[Link] = {}
def mark_attendance(self, date, status):
[Link][date] = status
class AttendanceSystem:
def __init__(self):
[Link] = {}
def add_student(self, name):
[Link][name] = Student(name)
def mark_attendance(self, student_name, date,
status):
if student_name in [Link]:
[Link][student_name].mark_attendance(date,
status)
else:
print(f"Student {student_name} not found.")
def get_attendance(self, student_name):
if student_name in [Link]:
return
[Link][student_name].attendance
else:
print(f"Student {student_name} not found.")
# Example usage:
attendance_system = AttendanceSystem()
[Link]
Adding students with Indian names in English
attendance_system.add_student("Alisha")
attendance_system.add_student("Bharat")
attendance_system.add_student("Chandan")
# Marking attendance
attendance_system.mark_attendance("Alisha",
"2024-02-21", "Present")
attendance_system.mark_attendance("Bharat",
"2024-02-21", "Absent")
attendance_system.mark_attendance("Chandan",
"2024-02-21", "Present")
# Getting attendance
print(attendance_system.get_attendance("Alisha"))
print(attendance_system.get_attendance("Bharat"))
print(attendance_system.get_attendance("Chandan"))