pls help me to write the defining algorithm,pseudo code and desk checking(2 test cases each)
Solution:
pseudo code
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;
End of the Pseudo Code
Code For this problem in C++;
#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; }
pls help me to write the defining algorithm,pseudo code and desk checking(2 test cases each) Design...