Attendance App A simple Java-based application to manage student attendance for multiple course sections. The app allows instructors to set up student names and seat numbers, take attendance for each class session, and generate detailed attendance reports for each section.
Features Set up course sections and assign students. Take attendance for each student (on-time, late, excused, unexcused). Display detailed attendance reports for each section.
Installation Clone the repository:
git clone https://github.com/confidenceaffang/AttendanceApp.git Open the project in IntelliJ IDEA, Eclipse, or VS Code. Run the AttendanceApp class to test the functionality. Class & Method Descriptions Class: AttendanceApp The main class that handles the application flow, including setting up courses, taking attendance, and displaying reports.
Fields:
section1 and section2: Instances of the Course class representing two sections of a course. DOUBLE_LINE and SINGLE_LINE: Constants used to format output lines. Methods:
displayAppHeading(): Displays the app heading. setupCourses(): Prompts the user for course names and sets up the students for each course section. setupStudents(Course course): Allows the instructor to enter student names and seat numbers for each section. mainMenu(): Displays the main menu and handles user interaction for taking attendance and displaying reports. CourseAttendance(Course course): Takes attendance for students in the selected course section. StudentAttendance(Student student): Records attendance for a specific student. displayDetailReports(): Displays detailed attendance reports for both sections. main(String[] args): Main method to run the application. Class: Student The Student class represents an individual student and their attendance records.
Fields:
seat: The student's seat number. name: The student's name. onTime: The number of on-time attendances. late: The number of late attendances. excused: The number of excused attendances. unexcused: The number of unexcused absences. Methods:
getSeat(): Returns the student's seat number. getName(): Returns the student's name. getOnTime(): Returns the number of on-time attendances. getLate(): Returns the number of late attendances. getExcused(): Returns the number of excused attendances. getUnexcused(): Returns the number of unexcused absences. setSeat(int seat): Sets the student's seat number. Throws an exception if the seat number is negative. setName(String name): Sets the student's name. Throws an exception if the name is blank or contains only whitespace. updateAttendance(int type): Updates the student's attendance status (1=On Time, 2=Late, 3=Excused, 4=Unexcused). Throws an exception for invalid types. displayAttendance(): Displays the student's seat number, name, and attendance statistics. equals(Object object): Checks if two students are the same based on their seat number. toString(): Returns a string representation of the student (e.g., "#10 Billy"). Class: Course The Course class represents a course and keeps track of students' attendance for the course.
Fields:
name: The course's name. allStudents: A list to store the students enrolled in the course. Methods:
getName(): Returns the course's name. setName(String name): Sets the course's name, validating that it is not blank. getStudent(int seat): Returns a student by their seat number. If no student exists with the given seat number, it returns null. addStudent(String name, int seat): Adds a student to the course. It validates that the seat number is not already taken. displaySummaryReport(): Displays the total attendance statistics for all students in the course. displayDetailReport(): Displays detailed attendance statistics for each student in the course. toString(): Returns a string representation of the course's name.
Authors
