- Verified Java and Git setup.
- Initialized Git repository.
- Created basic project structure with
Main.java. - Successfully compiled and ran the initial application.
- 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.
- 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.
- 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.
- 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.
- Defined a
Storableinterface with atoDataString()method. - Modified
Student,Course, andAttendanceRecordclasses to implement theStorableinterface and provide their specifictoDataString()implementations (CSV format). - Created a
FileStorageServiceclass with asaveData(List<? extends Storable> items, String filename)method to writeStorableobjects to a text file. - Utilized
try-with-resourcesfor safe file handling (PrintWriter,FileWriter). - Demonstrated in
Main.javahow 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.
- Navigate to the project root directory.
- Compile:
javac src/com/school/*.java - Run:
java -cp src com.school.Main - Check the generated files:
students.txt,courses.txt,attendance_log.txt.
- students.txt: S1,Alice,10th Grade
- courses.txt: C1,Mathematics
- attendance_log.txt: S1,C1,Present