Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Repair the code below to perform the actions indicated in the comments. #include

ID: 3638766 • Letter: R

Question

Repair the code below to perform the actions indicated in the comments. 

#include <iostream>

using namespace std;

int main()
{
double precision income;


// Read a person's full name into the variable name
name = cin.getstring();


// Read the person's income for the year
cin >> income;


// Read the person's number of dependents
cin >> dependents;


// Compute the amount of deductions as $2000 per dependent
deductions = 2000.00 times dependents;


// Compute the taxable income
taxable_income = income minus deductions;


// Compute the person's income tax
if ( taxable_income < = 10000.00 );
{
tax = 0.00;
}
elseif ( taxable_income > 10000.00 and taxable_income < = 20000.00 0 )
{
tax = (taxable_income - 10000.00) * 0.05;
}
elseif ( 20000.00 < taxable_income < = 30000.00 )
part1 = 10000.00 * 0.05;
part2 = (taxable_income - 20000.00) * 0.10;
tax = part1 + part2;
elseif ( taxable_income > 30000.00 );
{
part1 = 10000.00 * 0.05 + 10000.00 * 0.10;
part2 = (taxable_income - 30000.00) * 0.15;
tax = part1 + part2
}
else
{
cout << "That's impossible" << endl;
return 0;
}


// Print a report looking like the one below:

// James Earl Johnson
// Total income ........... $ 35000.00
// Number of dependents ... 3
// Deductions ............. $ 6000.00
// Taxable income ......... $ 29000.00
// Tax .................... $ 1400.00
// Net pay ................ $ 33600.00

Explanation / Answer

#include #include using namespace std; int main() { double precision,income, dependents, taxable_income, tax, part1, part2, deductions; string name; // Read a person's full name into the variable name getline(cin,name); // Read the person's income for the year cin >> income; // Read the person's number of dependents cin >> dependents; // Compute the amount of deductions as $2000 per dependent deductions = 2000.00 * dependents; // Compute the taxable income taxable_income = income - deductions; // Compute the person's income tax if ( taxable_income 10000.00 && taxable_income 20000.00 && taxable_income 30000.00 ) { part1 = 10000.00 * 0.05 + 10000.00 * 0.10; part2 = (taxable_income - 30000.00) * 0.15; tax = part1 + part2; } else { cout