
Patrick B. answered 11/15/20
Math and computer tutor/teacher
using namespace std;
#include <iostream>
//high tax rates!
const float stateTaxPercent = 0.065;
const float federalTaxPercent = 0.28;
const float dependentDeductionPercent = 0.025;
Go()
{
float salary;
int numDeductions;
cout << "Please input the salary:>";
cin >> salary;
cout <<" How many deductions ?? :>";
cin >> numDeductions;
float stateTax = stateTaxPercent*salary;
float federalTax = federalTaxPercent*salary;
float dependants = numDeductions*dependentDeductionPercent*salary;
float totalWitheld = stateTax+federalTax+dependants;
float takeHomePay = salary - totalWitheld;
cout << "Salary: " << salary << endl;
cout << "State tax: " << stateTax << endl;
cout << "Federal tax: " << federalTax << endl;
cout << "Dependents: " << dependants << endl;
cout << "Total witheld: " << totalWitheld << endl;
cout << "Take-home pay: " << takeHomePay << endl;
}