Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string Lastname, Firstname, Middlename, Department;
- int Pagibig, PhilHealth, SSS, Grosspay, Dependent, Deductions, Hoursworked, Rate, OTPay, Netpay, Tax;
- char a;
- int main()
- {
- cout << "Enter to compute" << endl << endl;
- cout << "[A] Pay Roll Computation" << endl;
- cout << "[B] Budget Monitoring" << endl;
- cout << "[C] Exit" << endl;
- cin >> a;
- system("cls");
- switch (a)
- {
- case 'A':
- cout << "Payroll Computation" << endl;
- cout << "" << endl;
- cout << "Enter Employee's Lastname: ";
- cin >> Lastname;
- cout << "Enter Employee's Firstname: ";
- cin >> Firstname;
- cout << "Enter Employee's Middlename: ";
- cin >> Middlename;
- cout << "Department: ";
- cin >> Department;
- cout << "Number of Dependents: ";
- cin >> Dependent;
- cout << "Number of Hours Worked: ";
- cin >> Hoursworked;
- cout << "Enter Rate per Day: ";
- cin >> Rate;
- cout << endl << endl;
- if (Hoursworked> 40) {
- OTPay = (Hoursworked- 40) * Rate * 0.25;
- Grosspay = 40 * Rate + OTPay;
- }
- else {
- Grosspay = Hoursworked * Rate;
- }
- cout << "Payslip" << endl;
- cout << "" << endl;
- cout << "Employee Name : " << Lastname << "," << Firstname << " " << Middlename << endl;
- cout << "Department : " << Department << endl;
- cout << endl << endl;
- cout << "Deductions" << endl;
- cout << endl << endl;
- if (Grosspay <= 5000)
- {
- SSS = 105;
- }
- else if (Grosspay >= 5001 && Grosspay <= 10000)
- {
- SSS = Grosspay * 0.05;
- }
- else if (Grosspay >= 10001 && Grosspay <= 15000)
- {
- SSS = Grosspay * 0.08 + 75;
- }
- else if (Grosspay > 15000)
- {
- SSS = Grosspay * 0.12 + 110;
- }
- else if (Dependent == 0)
- {
- Tax = Grosspay * 0.12;
- }
- else if (Dependent >= 1 && Dependent <= 2)
- {
- Tax = Grosspay * 0.08;
- }
- else if (Dependent >= 3)
- {
- Tax = Grosspay * 0.032;
- }
- cout << "SSS:" << SSS << endl;
- Pagibig = 100;
- cout << "Pagibig : " << Pagibig << endl;
- PhilHealth = 120;
- cout << "PhilHealth : " << PhilHealth << endl;
- cout << endl << endl;
- Deductions = SSS + PhilHealth + Pagibig;
- cout << "Total Deductions : " << Deductions << endl;
- Netpay = Grosspay - Deductions - Tax;
- cout << endl << endl;
- cout << "OT Pay : " << OTPay<< endl;
- cout << "Gross Pay : " << Grosspay << endl;
- cout << "NET PAY : " << Netpay<<endl;
- system("pause");
- system("CLS");
- main();
- break;
- case 'B':
- cout << " " << endl;
- system("pause");
- system("CLS");
- main();
- break;
- case 'C':
- exit(0);
- break;
- default:
- cout << "Error! Invalid Answer " << endl;
- system("pause");
- system("CLS");
- main();
- break;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement