Skip to content

Ajayrazz/Employee-Payroll-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee Payroll Management System

A console-based Core Java application that manages employee records, calculates salaries, generates salary slips, and stores employee data using CSV file handling.


Features

  • Add Employee
  • View All Employees
  • Search Employee by ID
  • Generate Salary Slip
  • Calculate Tax Deduction
  • Save Employee Data to CSV File
  • Load Employee Data from CSV File

Employee Types

Full-Time Employee

Salary Formula:

Net Salary = (Basic Salary + Bonus) - Tax

Part-Time Employee

Salary Formula:

Net Salary = (Hourly Rate × Hours Worked) - Tax

Contract Employee

Salary Formula:

Net Salary = Contract Amount - Tax

Core Java Concepts Used

  • Object-Oriented Programming (OOP)
  • Abstraction
  • Interfaces
  • Inheritance
  • Polymorphism
  • Encapsulation
  • Collections Framework
  • Java 8 Streams
  • Exception Handling
  • File Handling (CSV)

Project Structure

EmployeePayrollSystem/
│
├── employees.csv
├── out/
├── src/
│   ├── Main.java
│   │
│   ├── model/
│   │   ├── Employee.java
│   │   ├── FullTimeEmployee.java
│   │   ├── PartTimeEmployee.java
│   │   ├── ContractEmployee.java
│   │   └── Taxable.java
│   │
│   ├── service/
│   │   ├── PayrollService.java
│   │   └── FileService.java
│   │
│   └── exception/
│       └── PayrollException.java

Technologies Used

  • Java
  • Java Collections Framework
  • Java Streams API
  • File Handling
  • CSV Storage

How to Compile

Open terminal inside the project folder and run:

javac -d out src/Main.java src/model/*.java src/service/*.java src/exception/*.java

How to Run

java -cp out Main

Application Menu

===== Employee Payroll System =====
1. Add Employee
2. View All Employees
3. Search Employee by ID
4. Generate Salary Slip
5. Calculate Tax for Employee
6. Save Data to File
7. Load Data from File
8. Exit
===================================

CSV File Storage

Employee data is stored in:

employees.csv

Example:

FULLTIME,E001,Ajay,Research And Development,50000.0,5000.0
PARTTIME,E002,Rahul,IT,200.0,80.0
CONTRACT,E003,Aman,Finance,80000.0

Example Salary Slip

==============================
SALARY SLIP
ID     : E001
Name   : Ajay
Dept   : Research And Development
Type   : Full-Time
Gross  : ₹55000.0
Tax    : ₹5500.0
Net    : ₹49500.0
==============================

Exception Handling

The application handles:

  • Duplicate Employee IDs
  • Employee Not Found
  • Invalid Menu Inputs
  • File Handling Errors

using a custom exception:

PayrollException

Future Improvements (Optional)

  • Java Swing / JavaFX GUI
  • MySQL or SQLite Database Integration
  • JDBC Connectivity
  • Login Authentication System
  • Admin Dashboard
  • JUnit Testing

Resume Description

Developed a console-based Employee Payroll Management System using Core Java, OOP principles, Collections Framework, Java Streams, and File Handling. Implemented role-based salary calculation, tax deduction, employee record management, salary slip generation, and CSV-based data persistence.


Author

Ajay Razz


Employee Payroll Management System — Working Guide

1. How to Start the Application

Open terminal inside your project folder.

Example:

cd EmployeePayrollSystem

Compile the project:

javac -d out src/Main.java src/model/*.java src/service/*.java src/exception/*.java

Run the application:

java -cp out Main

2. Main Menu Options

After running, you will see:

===== Employee Payroll System =====
1. Add Employee
2. View All Employees
3. Search Employee by ID
4. Generate Salary Slip
5. Calculate Tax for Employee
6. Save Data to File
7. Load Data from File
8. Exit
===================================

3. How to Add Employee Data

Choose:

1

Then select employee type:

1 → Full-Time
2 → Part-Time
3 → Contract

Example:

Choose an option: 1
Choose Employee Type: 1
Enter Employee ID: E001
Enter Name: Ajay
Enter Department: Research And Development
Enter Basic Salary: 50000
Enter Bonus: 5000

After successful entry:

Employee added successfully.

4. How to View All Employees

Choose:

2

This prints all employee records currently stored in memory.


5. How to Search Employee by ID

Choose:

3

Example:

Enter Employee ID: E001

The application will display employee details if found.


6. How to Generate Salary Slip

Choose:

4

Example:

Enter Employee ID: E001

Output example:

==============================
SALARY SLIP
ID     : E001
Name   : Ajay
Dept   : Research And Development
Type   : Full-Time
Gross  : ₹55000.0
Tax    : ₹5500.0
Net    : ₹49500.0
==============================

7. How to Calculate Tax

Choose:

5

Example:

Enter Employee ID: E001

Output:

Tax for Ajay: ₹5500.0

8. How to Save Data into CSV File

Choose:

6

This saves all employee records into:

employees.csv

You can also save automatically by choosing:

8 → Exit

because the application auto-saves before closing.


9. How to Verify CSV Data

Run this command in terminal:

cat employees.csv

Expected output example:

FULLTIME,E001,Ajay,Research And Development,50000.0,5000.0
PARTTIME,E002,Rahul,IT,200.0,80.0
CONTRACT,E003,Aman,Finance,80000.0

10. How to Open employees.csv File

Mac/Linux

Open directly:

open employees.csv

OR view in terminal:

cat employees.csv

VS Code

Open the project folder in VS Code.

Then click:

employees.csv

from the Explorer sidebar.


11. How to Load Existing CSV Data

Choose:

7

This reads employee data from employees.csv and loads it into the application.

The app may also auto-load data when it starts.


12. How to Exit Application

Choose:

8

This:

  • saves data automatically
  • closes the application safely

Important Notes

  • Data is first stored in memory.

  • CSV updates only after:

    • Option 6 → Save Data
    • Option 8 → Exit
  • Invalid menu choices show:

Invalid option. Try again.
  • Employee IDs should be unique.

Quick Full Workflow

1 → Add Employee
2 → View Employees
4 → Generate Salary Slip
6 → Save Data
cat employees.csv → Verify CSV
8 → Exit

About

Employee Payroll Management System is a console-based Core Java application that manages employee records, calculates salaries, generates salary slips, and stores employee data using CSV file handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages