Skip to content

kalviumcommunity/chaitanya_s86_Attendence_management_project

Repository files navigation

Attendance Management System

Session 1: Introduction and Orientation

  • Verified Java and Git setup.
  • Initialized Git repository.
  • Created basic project structure with Main.java.
  • Successfully compiled and ran the initial application.

Session 2: Core Domain Modelling

  • Defined Student class with studentId, name, setDetails(), and displayDetails() method.
  • Defined Course class with courseId, courseName, setDetails(), and displayDetails() method.
  • Utilized arrays of objects in Main.java to manage and display multiple students and courses.
  • Introduced basic usage of this keyword.

Session 3: Constructor Initialization & Auto-ID Generation

  • Implemented parameterized constructors in Student and Course classes for object initialization.
  • Utilized private static member variables for automatic and unique ID generation.
  • Demonstrated the use of the this keyword to distinguish instance variables from constructor parameters.
  • Changed Course's courseId to int for simpler auto-generation and updated its display.
  • Updated Main.java to use constructors and show ID progression.

Session 4: Data Encapsulation & Attendance Recording Validation

  • Applied encapsulation to Student and Course classes by making fields private and adding public getters.
  • Introduced a new AttendanceRecord class with private fields, a constructor, and getters to store attendance data.
  • Implemented basic validation in the AttendanceRecord constructor for the attendance status (allowing only "Present" or "Absent").
  • Used an ArrayList in Main.java to store and display AttendanceRecord objects.
  • Demonstrated retrieving IDs using getters (e.g., student1.getStudentId()) when creating records.

Session 5: Establishing Students, Teaching & Non-Teaching Staff hierarchy

  • Created a base class Person.java with common attributes (id, name), a universal auto-ID generator, and a displayDetails() method.
  • Modified Student.java to inherit from Person, using super() to call the parent constructor and overriding displayDetails() to add student-specific info (e.g., grade level).
  • Created Teacher.java extending Person, adding a subjectTaught attribute and its own displayDetails().
  • Created Staff.java extending Person, adding a role attribute and its own displayDetails().
  • Demonstrated creation and display of Student, Teacher, and Staff objects in Main.java.
  • Updated AttendanceRecord creation to use the inherited getId() method.

Part 6: Interface-Driven Persistence with Storage

  • Defined a Storable interface with a toDataString() method.
  • Modified Student, Course, and AttendanceRecord classes to implement the Storable interface and provide their specific toDataString() implementations (CSV format).
  • Created a FileStorageService class with a saveData(List<? extends Storable> items, String filename) method to write Storable objects to a text file.
  • Utilized try-with-resources for safe file handling (PrintWriter, FileWriter).
  • Demonstrated in Main.java how to save lists of students, courses, and attendance records to separate files (students.txt, courses.txt, attendance_log.txt).
  • Discussed the flexibility provided by interfaces for handling different types of storable objects uniformly.

How to Run

  1. Navigate to the project root directory.
  2. Compile: javac src/com/school/*.java
  3. Run: java -cp src com.school.Main
  4. Check the generated files: students.txt, courses.txt, attendance_log.txt.

File Output Examples

  • students.txt: S1,Alice,10th Grade
  • courses.txt: C1,Mathematics
  • attendance_log.txt: S1,C1,Present

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages