Part 5
Part 5
// CPE2A
// TrainLaw , Philhealth , Pag-ibig , SSS
#include <iostream>
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 ;
switch (MonthlyDeduct) {
switch (MonthlyDeduct) {
// The code follows is for the computation of the sss and pagibig deduction
switch (MembershipType) {
switch (static_cast<int>(PagIBIGtax) ) {
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) ;
}; }
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 ; }
switch ( static_cast<int>(PagIBIGtax)) {
};
}
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) ;
}; }
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;
}
cout << " WAnt to try again ?? " << " Press 1 to proceed " << endl;
int Try;
cin >> Try ;
if (Try == 1) { goto startagain ; } ;
return 0; }