A command-line Java payroll application for MO-IT101 — Computer Programming 1.
Computes employee salaries, statutory deductions (SSS, PhilHealth, Pag-IBIG), and withholding tax from CSV data.
| Layer | Technology |
|---|---|
| Language | Java 17 |
| Build | Apache Maven |
| Testing | JUnit 5 (Jupiter + Parameterized) |
| Version Control | Git / GitHub |
| Data | CSV (employees & attendance) |
- Secure login (
admin/motorph123) with attempt limit. - Manage Employees with full CRUD:
- View all employees
- View full employee details
- Create new employee (auto-generated employee number)
- Update employee
- Delete employee
- Employee form guide
- Manage Attendance with full CRUD:
- View employee attendance
- Add record
- Update record
- Delete record
- Attendance form guide
- Manage Payroll:
- Generate monthly payslip for one employee
- Generate monthly payslip for all employees with attendance in selected month
- Generate weekly payslip for one employee
- Monthly payslip includes weekly attendance breakdown
- Employee Time-In/Time-Out:
- One time-in and one time-out per employee per day
- Prevents duplicate attendance actions
- Persists attendance updates to
data/attendance.csv
- About MotorPH informational screen.
- Unit tests: all 15 QA cases (QA-01–QA-15) automated with JUnit 5; run
mvn test(see Unit Tests).
After successful login:
1) Manage Employees
2) Manage Attendance
3) Manage Payroll
4) Employee Time-In/Time-Out
5) About MotorPH
6) Exit
1) Generate Monthly Payslip (Single Employee)
2) Generate Monthly Payslip (All Employees)
3) Generate Weekly Payslip (Single Employee)
4) Back
1) Time-In
2) Time-Out
3) Back
- Grace period: log-in at
8:10 AMor earlier is treated as8:00 AM. - Late login: after
8:10 AM, actual log-in time is used. - End-of-day cap: only work up to
5:00 PMis counted; overtime is excluded from payroll computation. - Lunch deduction: if worked minutes exceed 1 hour, 60 minutes are deducted.
- Payslip is generated per selected month.
- Output includes weekly attendance breakdown (Week, Days, Hours, Weekly Gross).
- Monthly gross is computed as the sum of all weekly gross values in that month.
- Deductions and tax are computed on monthly gross, then net monthly salary is shown.
- SSS: bracket-based contribution from monthly gross.
- PhilHealth: follows floor/cap logic (minimum and maximum employee share).
- Pag-IBIG: 1% or 2% rate with cap.
- Withholding Tax: computed from taxable income using progressive brackets.
Taxable income:
Taxable Income = Monthly Gross - (SSS + PhilHealth + Pag-IBIG)
MO-IT101---Computer-Programming-1/
├── pom.xml
├── README.md
├── LICENSE
├── docs/
│ └── qa-test-cases.md
├── src/
│ ├── main/java/
│ │ └── PayrollSystem.java
│ └── test/java/
│ ├── PayrollSystemQaTest.java
│ ├── PayrollDeductionsTest.java
│ └── QaTest15ColumnIndexConstantsTest.java
└── data/
├── employees.csv
└── attendance.csv
Employee and attendance data is loaded dynamically from CSV at startup. Run the program from the project root so relative paths resolve correctly.
- JDK 17+ installed (
java --version) - Apache Maven installed (
mvn --version)
# Option A: Maven (recommended)
mvn compile
mvn exec:java -Dexec.mainClass=PayrollSystem
# Option B: javac / java
mkdir -p target/classes
javac -d target/classes src/main/java/PayrollSystem.java
java -cp target/classes PayrollSystem| Field | Value |
|---|---|
| Username | admin |
| Password | motorph123 |
All 15 QA test cases (QA-01 through QA-15) are automated with JUnit 5. Running mvn test executes every case and reports Pass or Fail.
Full step-by-step descriptions are in docs/qa-test-cases.md.
| Class | QA coverage | What it tests |
|---|---|---|
PayrollSystemQaTest |
QA-01 – QA-15 (one @Test per QA number) |
Login, CSV loading, CRUD, payslip, time-in/out, deductions, source scan |
PayrollDeductionsTest |
QA-14 (extended) | PHP 25,000 reference + parameterized SSS/PhilHealth/tax bracket samples |
QaTest15ColumnIndexConstantsTest |
QA-15 (extended) | Source scan for magic emp[digits] / row[digits] |
| Item | Expected |
|---|---|
| SSS Deduction | 1,125 |
| PhilHealth Deduction | 375 |
| Pag-IBIG Deduction | 100 |
| Total Statutory Deductions | 1,600 |
| Taxable Income (25,000 − 1,600) | 23,400 |
| Withholding Tax (23,400 − 20,833) × 20% | 513.40 |
mvn testA successful run prints no failures; Maven reports tests executed under the surefire plugin.
Successful login + menu
========================================
MotorPH Payroll System
========================================
Username: admin
Password: motorph123
Login successful.
========================================
MotorPH Payroll System
========================================
1) Manage Employees
2) Manage Attendance
3) Manage Payroll
4) Employee Time-In/Time-Out
5) About MotorPH
6) Exit
Monthly payslip (single employee)
==========================================================
MONTHLY PAYROLL REPORT
==========================================================
Employee #: 10001 Name: Manuel III Garcia
Birthday : 10/11/1983 Position: Chief Executive Officer
Pay Period: June Hourly Rate: PHP 535.71
----------------------------------------------------------
WEEKLY ATTENDANCE BREAKDOWN
----------------------------------------------------------
Week Days Hours Weekly Gross
1 5 30.98 PHP 16,598.08
2 5 33.85 PHP 18,133.78
3 5 34.23 PHP 18,339.14
4 5 32.58 PHP 17,455.22
----------------------------------------------------------
Total 20 131.65 PHP 70,526.22
==========================================================
MONTHLY DEDUCTIONS
----------------------------------------------------------
SSS : PHP 1,125.00
PhilHealth : PHP 900.00
Pag-IBIG : PHP 100.00
Withholding Tax : PHP 11,353.27
Total Deductions : PHP 13,478.27
----------------------------------------------------------
GROSS MONTHLY PAY : PHP 70,526.22
NET MONTHLY SALARY: PHP 57,047.96
==========================================================
Weekly payslip (single employee)
==========================================================
WEEKLY PAYROLL REPORT
==========================================================
Employee #: 10001 Name: Manuel III Garcia
Birthday : 10/11/1983 Position: Chief Executive Officer
Pay Period: June Week 1 Hourly Rate: PHP 535.71
----------------------------------------------------------
Days Worked : 5
Hours Worked : 30.98
Gross Weekly : PHP 16,598.08
----------------------------------------------------------
WEEKLY DEDUCTIONS (prorated)
----------------------------------------------------------
SSS : PHP 281.25
PhilHealth : PHP 225.00
Pag-IBIG : PHP 25.00
Withholding Tax : PHP 2,838.32
Total Deductions : PHP 3,369.57
----------------------------------------------------------
NET WEEKLY SALARY : PHP 13,228.51
==========================================================
Edge cases
# Non-existent employee
Enter Employee Number: 99999
Employee not found.
# No attendance for selected month
Select month (1-12): 1
No attendance records found for that employee/month.
# Duplicate time-in
Enter Employee Number: 10001
You have already timed in today.
- Application logic is consolidated in one class,
src/main/java/PayrollSystem.java.pom.xmlandsrc/test/java/add Maven/JUnit testing; you can still compile and run withjavac/javaas shown in Getting Started. - Uses arrays, maps, and lists for data handling.
- Employee and attendance CRUD updates are in-memory during runtime; attendance clock actions also write back to
data/attendance.csv.
This project was developed with the assistance of AI tools, including ChatGPT (OpenAI, GPT-5.3).
AI was used for code suggestions, debugging, and documentation.
All AI-generated outputs were reviewed, modified, and validated by the author.
April Joyce Abejo
Aldrin John Tamayo
Mapua Malayan Digital College, a new college of Malayan Colleges Laguna, a Mapua school