1.Create a class and name it Payslip. This class should have the following attributes or properties: name, pay grade, basic salary, overtime hours, overtime pay, gross pay, net pay and withholding tax.
2.Define the accessors and mutators of the Payslip class based on its attributes or properties. This class should also have the following methods: determinePayGradeAndTaxRate and computePay.
3.Create another class and name it Employee. This class will contain the main method.
4.In the main method, instantiate an object of the Payslip class. Input the employee name, basic salary, and number of overtime (OT) hours. These values must be set to the object of the Payslip class. Apply validations for input as follows:
a.Basic salary should not be less than 10,000.
b.Minimum overtime hours is 1 hour.
5.Basic Salary Details:
Pay Grade A Pay Grade B Tax Rate
10,000 15,000 10%
20,000 25,000 15%
30,000 35,000 20%
40,000 45,000 25%
50,000 55,000 30% |
6. The computation is as follows:
Gross pay = basic salary + OT pay
OT pay = no. of OT hours * 1% of basic salary
Net pay = gross pay – withholding tax – fixed values
Withholding tax = gross pay * tax rate
Note: Basic salary greater than or equal to 55,000 will have a pay grade of B and a tax rate of 30%.
7.The following are fixed values:
SSS = 500.00
Pag-ibig = 200.00
Philhealth = 100.00
8.Output should contain the following:
Employee Name :
Basic Salary :
Pay Grade :
No. of OT Hours :
OT Pay :
Gross Pay :
Withholding Tax :
Net Pay : |
Note: Input of data and display of results should be defined on the main method. All monetary display should be formatted with comma separators, 2 decimal places, and “Php” (Ex: Php 32,546.95).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include "_pause.h"
using namespace std;
class PaySlip{
private:
string name;
int payGrade, basicSal, overtimeH, overtimeP, grossP, netP, withT;
public:
void setValue(string names, int payGrades, int basicSals, int overtimeHs, int overtimePs, int grossPs, int netPs, int withTs){
name = names;
payGrade = payGrades;
basicSal = basicSals;
overtimeH = overtimeHs;
overtimeP = overtimePs;
grossP = grossPs;
netP = netPs;
withT = withTs;
}
int getValue(){ // I am lacking of variable 'name' because the data type is string
return payGrade, basicSal, overtimeH, overtimeP, grossP, netP, withT;
}
int determinePayGradeAndTaxRate(){
}
int computePay(){
}
};
class Employee{
};
|
Help me step by step please, I want to clarify some steps.
1)How do I return values of those integers and a string?
2)What will I do with
determinePayGradeAndTaxRate and
computePay?
3)Should I inherit the properties from class PaySlip to class Employee?
4)How do I create an object of PaySlip inside the main method(included in class Employee)
5)Where will I put the int main? Is that the main method or not?