0% found this document useful (0 votes)
12 views

Week7 MachineProblem2 09072021A

The document provides instructions for a programming assignment to create a Java program that calculates employee payroll information. It specifies to create two classes - a main Employee class and a PaySlip class. The PaySlip class should contain attributes, constructors, and methods to calculate tax withholdings and compensation. The main method should input employee data, use the PaySlip class to calculate values, and output a pay slip with the employee name, salaries, taxes, deductions and net pay.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Week7 MachineProblem2 09072021A

The document provides instructions for a programming assignment to create a Java program that calculates employee payroll information. It specifies to create two classes - a main Employee class and a PaySlip class. The PaySlip class should contain attributes, constructors, and methods to calculate tax withholdings and compensation. The main method should input employee data, use the PaySlip class to calculate values, and output a pay slip with the employee name, salaries, taxes, deductions and net pay.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Computer Programming 2

Machine Problem 2

Week007 – Machine Problem 2

Objective/s:
At the end of this activity, you should be able to:
 define a class
 instantiate objects of the class
 invoke the methods of the class
 implement the required output
 compute the net income

What to Prepare for the Activity:


 NetBeans IDE 8.2 or the latest version
 JDK8 (Java Development Kit 8) or the latest version

Procedure:
 Create a NetBeans project for this activity.
Project Name: MP2_<lastname_firstname>
Example: MP2_Blanco_Maria
 Define 2 classes. The main class contains the main method.
Main Class: Employee_<lastname>
Example: Employee_Blanco

Other Class: PaySlip_<lastname>


Example: PaySlip_Blanco
 Compress the NetBeans project into .rar or .zip format and then upload to
the link provided in the LMS.
 Only NetBeans project will be accepted. Non-compliance will require
resubmission. The highest score for resubmission is 50%.

Write a Java program with the following specifications:

1. Define the attributes of the PaySlip class. Define the constructor for this class.

2. Define the setters (mutators) and the getters (accessors) for the PaySlip class.

3. Define also the custom methods in the PaySlip class as follows but not limited
to determineWithholdingTax( ) and computeCompensation( ).

4. Input the employee name, basic salary, and number of overtime (OT) hours.
Data input should be done in the main method. The final output as described in
#9 should be generated in the main method, as well.

5. Use the table below to compute the withholding tax.


Monthly Gross Income and Withholding Tax Details
Over But Not Over Withholding Tax
20,000 0%
20,000 31,000 20% of the excess over 20,000

Assessments
31,000 61,000 2,300 + 25% of the excess over 31,000
61,000 154,000 10,000 + 30% of the excess over 61,000
154,000 615,000 38,000 + 32% of the excess over 154,000
615,000 185,000 + 35% of the excess over 615,000

6. The computation is as follows:


Gross income = basic salary + OT pay
OT pay = no. of OT hours * 1% of basic salary
Net pay = gross income – withholding tax – other deductions
Withholding tax = based on the table above

7. The following are the other deductions:


SSS = 13% of the basic salary
Pag-ibig = 2% of the basic salary
Philhealth = 3.5% of the basic salary, maximum of 2,450

8. Use the Philippine Peso currency and 2 decimal places for all the monetary
value display.

9. The output should contain the following:


Date Generated (This is the system date.)
Employee Name
Basic Salary
No. of OT Hours
OT Pay
Gross Income
Withholding Tax
Other Deductions:
SSS
Pag-ibig
PhilHealth
Net Pay

You might also like