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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
#include <iostream>
#include <algorithm>
using namespace std;
int& max(int& a, int& b)
{
return a > b ? a : b;
}
int main()
{
int basic1, hra1, spl1, lta1, conv1, pf1, grat1, varpay1;
cout << "Current Basic Salary: \n";
cin >> basic1;
cout << "Current HRA: \n";
cin >> hra1;
cout << "Current Special Allowance: \n";
cin >> spl1;
cout << "Current LTA: \n";
cin >> lta1;
cout << "Current Conveyance/Transport Allowance: \n";
cin >> conv1;
cout << "Current PF: \n";
cin >> pf1;
cout << "Current Gratuity: \n";
cin >> grat1;
cout << "Current Variable Pay: \n";
cin >> varpay1;
int ctc1, tfp1, thp1;
tfp1 = basic1 + hra1 + lta1 + spl1 + conv1 + pf1 + grat1;
ctc1 = tfp1 + varpay1;
thp1 = tfp1 - 2 * (pf1 + grat1);
double basic1_pc, varpay1_pc;
basic1_pc = (static_cast<double>(basic1) / tfp1) * 100;
varpay1_pc = (static_cast<double>(varpay1) / ctc1) * 100;
cout << "Current CTC is " << ctc1 << "\n";
cout << "Current TFP is " << tfp1 << "\n";
cout << "Current Basic is " << basic1_pc << "% of Current TFP \n";
cout << "Current Variable Pay is " << varpay1_pc << "% of Current CTC \n";
cout << "Current Fixed Pre-Tax Take-Home Pay is " << thp1 << "\n";
double increment;
cout << "Increment (input as % value, eg. if 6%, input 6):\n";
cin >> increment;
int ctc2, varpay2, tfp2, basic2, hra2, lta2, pf2, conv2, spl2;
int basic2_plch;
ctc2 = ctc1 * (1 + (increment / 100));
varpay2 = 0.15 * ctc2;
tfp2 = ctc2 - varpay2;
spl2 = 0;
basic2_plch = 0.35 * tfp2;
basic2 = max(basic2_plch, basic1);
hra2 = 0.85 * basic2;
lta2 = basic2 / 12;
pf2 = 0.12 * basic2;
conv2 = basic2 / 12;
cout << "New CTC will be " << ctc2 << "\n";
cout << "New TFP will be " << tfp2 << "\n";
cout << "New Basic Salary will be " << basic2 << "\n";
cout << "New HRA will be " << hra2 << "\n";
cout << "New LTA will be " << lta2 << "\n";
cout << "New Conveyance Allowance will be " << conv2 << "\n";
cout << "New PF will be " << pf2 << "\n";
int wage2_plch, remainder2;
wage2_plch = 0.5 * tfp2;
remainder2 = tfp2 - basic2 - hra2 - lta2 - conv2 - pf2;
while (remainder2 > 0)
{
int incl2 = basic2 + spl2 + lta2;
int grat2 = max(incl2, wage2_plch) * (5 / 104);
remainder2 = remainder2 - spl2 - grat2;
spl2++;
}
cout << "New Special Allowance will be " << spl2 << "\n";
cout << "New Variable Pay will be " << varpay2 << "\n";
return 0;
}
|