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

part 3

The document is a C++ program that calculates monthly income deductions for taxes, Philhealth, Pag-IBIG, and SSS in the Philippines based on user input. It includes various tax rates and deduction rules depending on the user's monthly income and membership type. The program outputs the user's gross income, deductions, and net income after calculations.

Uploaded by

Manuel Latayan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

part 3

The document is a C++ program that calculates monthly income deductions for taxes, Philhealth, Pag-IBIG, and SSS in the Philippines based on user input. It includes various tax rates and deduction rules depending on the user's monthly income and membership type. The program outputs the user's gross income, deductions, and net income after calculations.

Uploaded by

Manuel Latayan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

//Latayan Manuel R.

// CPE2A
// TrainLaw , Philhealth , Pag-ibig , SSS

#include <iostream>

using namespace std;

int main() {
//Declaration of the variable
int AnnualIncome, Tax, Monthly, MembershipType, PagIBIGtax, sssContribution,
TotalsssContribution, i =0 ;
int Branch, MonthlyDeduct, b = 200, x= 0, LowBracketsss, HighBracketsss;
double traintaxrate [] { .35, 0.32, 0.25, 0.20, 0.15} , pagIbigRate[]
{ 0.001,0.002,0.003} ;

int trainTaxrateNo = sizeof(traintaxrate)/sizeof(traintaxrate[0]) ; // we are


trying to get here the size of the array
int pagIbigRateNo = sizeof(pagIbigRate)/sizeof(pagIbigRate[0]) ;
double Philhealth, Netincome ;

cout<< " Welcome To The Philippines"<<endl


<< " Train Law Calculator with Philhealth Deduction" <<endl
<< " Please Enter your Monthly Income in Peso , Thank youu!! " <<endl;
cin >> Monthly ;

// for computation of Philhealth deduction every Month


if (Monthly >=0 && Monthly <= 10000) {
MonthlyDeduct = 1 ;
} else if (Monthly >= 10000.01 && Monthly <= 99999.99) {
MonthlyDeduct = 2 ;
} else if (Monthly >= 100000) {
MonthlyDeduct =3 ;
}

switch (MonthlyDeduct) {

case 1 : Philhealth = 500 ;


break ;
case 2 : Philhealth = (Monthly * 0.025) ;
break ;
case 3 : Philhealth = ( 2500) ;
break;
}

if (Monthly >=0 && Monthly <= 10000) {


MonthlyDeduct = 1 ;
} else if (Monthly >= 10000.01 && Monthly <= 99999.99) {
MonthlyDeduct = 2 ;
} else if (Monthly >= 100000) {
MonthlyDeduct =3 ;
}

switch (MonthlyDeduct) {

case 1 : Philhealth = 500 ;


break ;
case 2 : Philhealth = (Monthly * 0.025) ;
break ;
case 3 : Philhealth = ( 2500) ;
break; }

// Pag ibig computation


Repeat:
cout << " Please provide the details needed in Pag-IBIG & SSS Deduction" <<endl
<< " What is your Membership type "<< endl
<< " 1. Self employed " << endl
<< " 2. OFWs " << endl
<< " 3. Employee " << endl
<< " 4. Kasambahay " << endl
<< " 5. Voluntary And Non-working Spouse " << endl
<< " Please Choose from 1- 4 " << endl ;
cin >> MembershipType ;

int EC = (Monthly < 14750) ? 10:30;


switch (MembershipType) {

case 1 : if (Monthly >=0 && Monthly <= 1499) {


PagIBIGtax = 1 ;
}else if (Monthly >= 1500 && Monthly <= 4999) {
PagIBIGtax = 2 ;
} else if (Monthly >= 5000) {
PagIBIGtax =3 ; }

if (Monthly <4250) { sssContribution = 560; } else if( Monthly >=


20250 ) {
sssContribution =2800 ; } else if (Monthly < 20250 && Monthly >
4250)
{ HighBracketsss = 4250 ; LowBracketsss = x -500;
while ( Monthly >= HighBracketsss ) { i++ ;
HighBracketsss = 4250 + i*500 ;
LowBracketsss = HighBracketsss ;
sssContribution = 560 + (i*70) ; } }

switch (static_cast<int>(PagIBIGtax) ) {

case 1 : PagIBIGtax = Monthly*0.001 ;

break ;
case 2 : PagIBIGtax = (Monthly * 0.002) ;
break ;
case 3 : PagIBIGtax = (5000*0.003) ;
break; }

case 2 : if (Monthly >=0 && Monthly <= 1499) {


PagIBIGtax = 1 ;
}else if (Monthly >= 1500 && Monthly <= 4999) {
PagIBIGtax = 2 ;
} else if (Monthly >= 5000) {
PagIBIGtax =3 ; }

switch ( static_cast<int>(PagIBIGtax)) {

case 1 : PagIBIGtax = Monthly*0.001 ;


break ;
case 2 : PagIBIGtax = (Monthly * 0.002) ;
break ;
case 3 : PagIBIGtax = (Monthly*0.003) ;
break; }
case 3 :

case 4:

break;

case 5:
default : cout << " Invalid Membership Type " << endl;
}
if (MembershipType >= 6 ) { goto Repeat; }
AnnualIncome = Monthly *12 ; // to get the Annual income

// The code below here is to compute the tax annually


if (AnnualIncome > 8000000)
{ Branch = 1;
}

else if (AnnualIncome <= 8000000 && AnnualIncome > 2000000){


Branch = 2;
} else if (AnnualIncome <= 2000000 && AnnualIncome > 800000) {
Branch = 3;
} else if ( AnnualIncome <=800000 && AnnualIncome >400000 ) {
Branch = 4 ;
} else if (AnnualIncome <=400000 && AnnualIncome >250000 ) {
Branch = 5;
} else if ( AnnualIncome <= 250000 ) { Branch = 6; }

switch (Branch) {

case 1 : Tax = 2202500 + ( AnnualIncome-8000000 )*traintaxrate[0] ;


break ;
case 2 : Tax = 402500 + ( AnnualIncome-2000000 )*traintaxrate[1] ;
break ;
case 3 : Tax = 102500 + ( AnnualIncome-800000 )*traintaxrate[2] ;
break ;
case 4 : Tax = 22500 + ( AnnualIncome-400000 )*traintaxrate[3] ;
break ;
case 5 : Tax = ( AnnualIncome-250000 )*traintaxrate[4] ;
break ;
case 6 : Tax = 0 ;
} TotalsssContribution = sssContribution + EC ;
Tax/=12; // The Annual tax is divided to 12 to get the monthly tax
Netincome = Monthly - Tax - Philhealth - TotalsssContribution -
PagIBIGtax ;

// We are prompting the necessary details


cout << " Your Monthly pay / Gross Income is " << Monthly << " Pesos "
<< endl
<< " The Tax Deduction is " << Tax << " Pesos " <<
endl
<< " The Pag-IBIG Deduction is " << PagIBIGtax << " Pesos
" << endl
<< " The Philhealth Deduction is " << Philhealth << " Pesos "
<< endl
<< " The SSS Deduction is " << TotalsssContribution <<
" Pesos " << endl
<< " Your Net income Monthly is " << Netincome << " Pesos "
<< endl;

return 0; }

You might also like