#include <iostream>
int main() {
float income, tax, grossTax;
std::cout << "Please input your income" << std::endl;
std::cin >> income;
if ( income < 20000 ) {
tax = 0;
} else if ( income >= 20000 && income < 30000 ) {
tax = 0.02;
} else if ( income >= 30000 && income < 40000 ) {
tax = 0.035;
} else if ( income >= 40000 && income < 80000 ) {
tax = 0.07;
} else if ( income >= 80000 && income < 120000 ) {
tax = 0.115;
} else if ( income >= 120000 && income < 160000 ) {
tax = 0.15;
} else if ( income >= 160000 && income < 200000 ) {
tax = 0.17;
} else if ( income >= 200000 && income < 320000 ) {
tax = 0.18;
} else if ( income >= 320000 ) {
tax = 0.2;
}
grossTax = income * tax;
std::cout << "Tax to be paid : " << tax * 100 << "%.\n" << "Gross tax payble : " << grossTax << "." << std::endl;
std::cout << "Taxpayer has left : " << income - grossTax << std::endl;
return 0;
}
Comments
Leave a comment