5
Tax
- // 2005
- //
- // 4 334 6,83% 286,18 286.18
- // 8 524 19,14% 1 240,27 1 526,45
- // 15 004 28,26% 2 625,35 4 151,81
- // 24 294 37,38% 5 694,84 9 846,65
- // 39 529 42,62% 3 928,71 13 775,36
- // 48 747 48,09%
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- #include <assert.h>
- int ir( double revenue, double shares ) {
- double base, tax;
- double rate;
- assert( shares > 0.0 );
- revenue *= 0.90; // 10% off for expenses
- revenue *= 0.80; // 20% off like everybody else
- base = revenue / shares;
- cout << "Base value is: " << base << endl;
- if ( base > 48747 )
- tax = 13775.36 + (base - 48747) * ((rate=48.09)/100);
- else if ( base > 39529 )
- tax = 9846.65 + (base - 39529) * ((rate=42.62)/100);
- else if ( base > 24294 )
- tax = 4151.81 + (base - 24294) * ((rate=37.38)/100);
- else if ( base > 15004 )
- tax = 1526.45 + (base - 15004) * ((rate=28.26)/100);
- else if ( base > 8524 )
- tax = 286.18 + (base - 8524) * ((rate=9.14)/100);
- else if ( base > 4334 )
- tax = 0 + (base - 4334) * ((rate=6.83)/100);
- else
- tax = rate = 0;
- cout << "Highest rate is: " << rate << "%" << endl;
- tax *= shares;
- return tax;
- }
- int main() {
- double revenue;
- double shares;
- double tax;
- cout << "Enter global revenue: ";
- cin >> revenue;
- cout << "Number of shares? ";
- cin >> shares;
- tax = ir( revenue, shares );
- cout << "Your income tax before deductions is: " << tax << endl;
- cout << "Your real tax rate is " << (tax / revenue) * 100 << "%" << endl;
- exit( 0 );
- }
Comments