0% found this document useful (0 votes)
6 views5 pages

Part 6

This document contains a C++ program that calculates tax deductions for individuals in the Philippines based on their monthly income. It computes deductions for Philhealth, Pag-IBIG, and SSS contributions, and determines the net income after tax deductions. The program includes user prompts for input and allows for multiple calculations in a single session.

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)
6 views5 pages

Part 6

This document contains a C++ program that calculates tax deductions for individuals in the Philippines based on their monthly income. It computes deductions for Philhealth, Pag-IBIG, and SSS contributions, and determines the net income after tax deductions. The program includes user prompts for input and allows for multiple calculations in a single session.

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/ 5

//Latayan Manuel R.

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

#include <iostream>

using namespace std;

int main() {
//Declaration of the variable
int AnnualIncome, PagIBIGtax,TotalsssContribution, BracketWISPSSS,Netincome, i
=0 ;
int Branch, Monthly,Tax, MonthlyDeduct,MembershipType, b = 200, x= 0,
Bracketsss, EC;
double traintaxrate [] { .35, 0.32, 0.25, 0.20, 0.15} , pagIbigRate[]
{ 0.001,0.002,0.003} ;
double WISPcontribution, sssContribution, Philhealth ;
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]) ;

startagain :
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. Land based OFWs " << endl
<< " 3. Employee, Kasambahay, HouseHold workers and Sea-based OFWs
" << endl
<< " 4. Voluntary And Non-working Spouse " << endl
<< " Please Choose from 1- 4 " << endl ;
cin >> MembershipType ;

// The code follows is for the computation of the sss and pagibig deduction
switch (MembershipType) {

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


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 = (5000*0.003) ;
break; }
if (Monthly <4250) {

sssContribution = 560;
WISPcontribution = 0 ; break;}
else if( Monthly >= 20250 ){
int j= 0 ;
sssContribution =2800 ;
Bracketsss = 20250 ;
while (Monthly>= Bracketsss ) { ++j;
Bracketsss = 20250 + j*500 ;
WISPcontribution = (j*70) ;

if (Monthly >= 29750 ) { WISPcontribution = (1400) ;


break;
}

}; }
else if (Monthly < 20250 && Monthly >= 4250){

Bracketsss = 4250 ;
while ( Monthly >= Bracketsss ) { ++i ;
Bracketsss = 4250 + i*500 ;
WISPcontribution = 0 ;
sssContribution = 560 + (i*70) ; }
break ;}

break;

case 2 : EC=0 ;
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; }
// for sss contribution
if (Monthly < 8250) { sssContribution = 1120 ;}
else if ( Monthly >=20250 ){
int j= 0 ;
sssContribution =2800 ;
Bracketsss = 20250 ;
while (Monthly>= Bracketsss ) { ++j;
Bracketsss = 20250 + j*500 ;
WISPcontribution = (j*70) ;
if (Monthly >= 29750 ) { WISPcontribution = (1400) ;
break;
}

};

}
else if ( Monthly < 20250 && Monthly >= 8250) {
Bracketsss = 8250 ;
while (Monthly >= Bracketsss) {
++i;
Bracketsss = 8250 + ( i*500) ;
WISPcontribution=0;
sssContribution = 1120 + ( i*70) ;
} ; }
break ;

case 3: EC = 0 ;
if (Monthly < 4250) {
sssContribution = 180 ;}
else if (Monthly > 4250 && Monthly <= 29749.99) {
sssContribution = (Monthly * 0.045) ;
}
else if ( Monthly >=29750) {
sssContribution = (1350) ;
};
break;

case 4: EC= 0;
if (Monthly <4250) {

sssContribution = 560;
WISPcontribution = 0 ; break;}
else if( Monthly >= 20250 ){
int j= 0 ;
sssContribution =2800 ;
Bracketsss = 20250 ;
while (Monthly>= Bracketsss ) { ++j;
Bracketsss = 20250 + j*500 ;
WISPcontribution = (j*70) ;

if (Monthly >= 29750 ) { WISPcontribution = (1400) ;


break;
}

}; }
else if (Monthly < 20250 && Monthly >= 4250){

Bracketsss = 4250 ;
while ( Monthly >= Bracketsss ) { ++i ;
Bracketsss = 4250 + i*500 ;
WISPcontribution = 0 ;
sssContribution = 560 + (i*70) ; }
break ;}

break;

default : cout << " Invalid Membership Type " << endl;
}

if (MembershipType >= 5 ) { 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; }
cout << EC << endl
<< " WISPcontribution " << WISPcontribution << endl
<< sssContribution << endl;
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 + WISPcontribution + 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;

cout << " WAnt to try again ?? " << " Press 1 to proceed " << endl;
int Try;
cin >> Try ;
if (Try == 1) { goto startagain ; } ;
return 0; }

You might also like