Attendance Management System: Submitted in Fulfillment of The Requirements of Micro-Project Advanced Computer Networking
Attendance Management System: Submitted in Fulfillment of The Requirements of Micro-Project Advanced Computer Networking
By
“ UGALMUGALE MAHEE MILIND
CHASKAR ATHARVA NAVNATH
BHARTI PRIYA PHOOLCHAND”
ROLL NO:- 31
32
33
2209640201
2209640203
SUBJECT INCHARGE
Mrs. Smita Kuldiwar
is submitted for
By
CHASKAR 2209640201
ATHARVA
53 NAVNATH
SUBJECT INCHARGE
Mrs. Smilta Kuldiwar
Vision: -
To provide technically competent and skilled diploma computer
engineers to fulfill the needs of industry and society.
Mission: -
M1:- To provide industry oriented quality education and training.
M2:- To impart and inculcate theoretical and practical knowledge.
M3:- To provide interpersonal skills and social ethics.
COMPUTER ENGINEERING DEPARTMENT
PROGRAMME OUTCOMES
PO7: Life-long learning: Ability to analyze individual needs and engage in updating
in the context of technological changes
COMPUTER ENGINEERING DEPARTMENT
PROGRAMME EDUCATIONAL OBJECTIVES
PEO1: Provide socially responsible, environment friendly solutions to
Computer engineering related broad-based problems adapting professional ethics.
Course Outcomes:
It encourages the direct use of remote computers.
It shields users from system variations (operating system, directory structures, file structures, etc.)
Proposed Methodology:
● Firstly we search the topic for which we want to make a project, and then propose it to
the Subject In charge.
● After finalizing the topic, start gathering the information about your project.
● Now, it’s time to make a report of your Selected Project.
Action Plan:
Literature:
The development of an Attendance Management System (AMS) using Java has been a popular project for
students and professionals, offering improved efficiency, accuracy, and accessibility. Java's Object-Oriented
Programming (OOP) features make it an ideal choice for structured, modular, and scalable systems like
AMS. Java Database Connectivity (JDBC) allows for seamless data interaction between the application and
the database. The user interface (UI) is crucial for AMS applications, and Java Swing or JavaFX provide
powerful components for a user-friendly interface. Security and authentication are major concerns in AMS
development, and Java's built-in security libraries, such as the Java Cryptography Architecture (JCA), can
enhance security. Automated attendance reports are essential for monitoring student performance or
employee presence, and Java can be easily extended with additional features like real-time tracking, mobile
integration, or notifications. Java's cross-platform capabilities ensure the system can be deployed on
different operating systems, further enhancing its scalability.
Resources Required
Sr. Name of Resources Specification Qty. Remark
No.
Source Code
Student.java
public class Student {
private String name;
private long id; // Changed from int to long
Attendance.java
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Attendance {
private List<Student> students;
private Map<Long, Integer> attendanceRecord; // Maps student ID to the number of attended classes
public Attendance() {
students = new ArrayList<>();
attendanceRecord = new HashMap<>();
}
public void addStudent(Student student) {
students.add(student);
attendanceRecord.put(student.getId(), 0); // Initialize attendance count to 0
}
public List<Student> getAllStudents() {
return students;
}
public void markAttendance(Student student, boolean isPresent) {
if (isPresent) {
attendanceRecord.put(student.getId(), attendanceRecord.get(student.getId()) + 1);
}
}
public double getAttendancePercentage(Student student) {
int totalClasses = attendanceRecord.size(); // Assuming each student has attended the same number of
classes
int attendedClasses = attendanceRecord.getOrDefault(student.getId(), 0);
return (double) attendedClasses / totalClasses * 100;
}
}
AttendanceManagerGUI.jav
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
public class AttendanceManagerGUI extends JFrame {
private Attendance attendance;
private JTable table;
private DefaultTableModel tableModel;
private JTextField searchField;
public AttendanceManagerGUI() {
attendance = new Attendance();
setTitle("Enhanced Attendance Management System");
setSize(800, 600);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout());
JPanel navPanel = new JPanel();
navPanel.setLayout(new GridLayout(5, 1));
JButton addStudentBtn = new JButton("Add Student");
JButton markAttendanceBtn = new JButton("Mark Attendance (Bulk)");
JButton summaryBtn = new JButton("View Summary");
JButton reportBtn = new JButton("Generate Report");
addStudentBtn.addActionListener(e -> showAddStudentDialog());
markAttendanceBtn.addActionListener(e -> showBulkAttendanceDialog());
summaryBtn.addActionListener(e -> showSummaryDialog());
reportBtn.addActionListener(e -> generateAttendanceReport());
navPanel.add(addStudentBtn);
navPanel.add(markAttendanceBtn);
navPanel.add(summaryBtn);
navPanel.add(reportBtn);
add(navPanel, BorderLayout.WEST);
JPanel searchPanel = new JPanel(new FlowLayout());
searchField = new JTextField(20);
JButton searchButton = new JButton("Search");
searchButton.addActionListener(e -> searchStudent());
searchPanel.add(new JLabel("Search by Name or ID:"));
searchPanel.add(searchField);
searchPanel.add(searchButton);
add(searchPanel, BorderLayout.NORTH);
tableModel = new DefaultTableModel(new Object[]{"ID", "Name", "Attendance %"}, 0);
table = new JTable(tableModel);
JScrollPane tableScrollPane = new JScrollPane(table);
add(tableScrollPane, BorderLayout.CENTER);
}
private void showAddStudentDialog() {
JTextField nameField = new JTextField();
JTextField idField = new JTextField();
Object[] message = {"Name:", nameField, "ID:", idField};
int option = JOptionPane.showConfirmDialog(this, message, "Add New Student",
JOptionPane.OK_CANCEL_OPTION);
if (option == JOptionPane.OK_OPTION) {
String name = nameField.getText();
String idText = idField.getText();
if (name.isEmpty() || idText.isEmpty()) {
JOptionPane.showMessageDialog(this, "All fields must be filled", "Input Error",
JOptionPane.ERROR_MESSAGE);
return;
}
try {
long id = Long.parseLong(idText);
Student student = new Student(name, id);
attendance.addStudent(student);
updateTable();
JOptionPane.showMessageDialog(this, "Student added successfully!");
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "ID must be a numeric value", "Input Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
private void showBulkAttendanceDialog() {
List<Long> presentIds = new ArrayList<>();
JTextArea inputArea = new JTextArea(5, 20);
JScrollPane scrollPane = new JScrollPane(inputArea);
Object[] message = {"Enter student IDs (comma-separated) for present students:", scrollPane};
int option = JOptionPane.showConfirmDialog(this, message, "Bulk Attendance",
JOptionPane.OK_CANCEL_OPTION);
if (option == JOptionPane.OK_OPTION) {
String inputText = inputArea.getText();
String[] ids = inputText.split(",");
for (String idStr : ids) {
try {
long id = Long.parseLong(idStr.trim());
presentIds.add(id);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Invalid ID: " + idStr, "Input Error",
JOptionPane.ERROR_MESSAGE);
}
}
for (Student student : attendance.getAllStudents()) {
attendance.markAttendance(student, presentIds.contains(student.getId()));
}
updateTable();
JOptionPane.showMessageDialog(this, "Bulk attendance updated successfully.");
}
}
private void showSummaryDialog() {
String input = JOptionPane.showInputDialog(this, "Enter minimum attendance percentage:");
try {
double threshold = Double.parseDouble(input);
tableModel.setRowCount(0);
for (Student student : attendance.getAllStudents()) {
double attendancePercent = attendance.getAttendancePercentage(student);
if (attendancePercent >= threshold) {
tableModel.addRow(new Object[]{student.getId(), student.getName(), attendancePercent});
}
}
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Please enter a valid number.", "Input Error",
JOptionPane.ERROR_MESSAGE);
}
}
private void generateAttendanceReport() {
StringBuilder report = new StringBuilder("Attendance Report:\n");
for (Student student : attendance.getAllStudents()) {
double attendancePercent = attendance.getAttendancePercentage(student);
report.append(String.format("ID: %d, Name: %s, Attendance: %.2f%%\n", student.getId(),
student.getName(), attendancePercent));
}
JTextArea reportArea = new JTextArea(report.toString());
reportArea.setEditable(false);
JOptionPane.showMessageDialog(this, new JScrollPane(reportArea), "Attendance Report",
JOptionPane.INFORMATION_MESSAGE);
}
private void searchStudent() {
String query = searchField.getText().trim();
tableModel.setRowCount(0);
for (Student student : attendance.getAllStudents()) {
if (student.getName().contains(query) || String.valueOf(student.getId()).contains(query)) {
tableModel.addRow(new Object[]{student.getId(), student.getName(),
attendance.getAttendancePercentage(student)});
}
}
}
private void updateTable() {
tableModel.setRowCount(0);
for (Student student : attendance.getAllStudents()) {
tableModel.addRow(new Object[]{student.getId(), student.getName(),
attendance.getAttendancePercentage(student)});
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> new AttendanceManagerGUI().setVisible(true));
}
}
Output:
Conclusion:
An Attendance Management System (AMS) using Java is a powerful application of advanced programming
concepts, combining Object-Oriented Programming, database connectivity, user interface design, and
security. It improves attendance management efficiency, allows for easy scalability, and is modular,
allowing developers to add new features with minimal changes. Its platform independence ensures it can be
deployed across various environments, making it an excellent project for students learning advanced Java
concepts.
Skill Developed:
1. Database Integration and SQL Handling.
2. Graphical User Interface (GUI) Design.
Application:
Student Attendance Tracking
Employee Attendance Management
Real-Time Attendance Monitoring
Automated Report Generation and Notifications
Subject In-charge
(Ms. Smita Kuldiwar)