Question

In: Computer Science

Write a program that can calculate the amount of federal tax aperson owes for the...

Write a program that can calculate the amount of federal tax a person owes for the upcoming year.

After calculating the amount of tax owed, you should report to the user their filing status (single/joint), which tax rate they fell under, as well as the tax owed. Example: “As a single filer you fell under 12% tax bracket and you owe $3500.”

Disclaimer: This example is simplified and is not intended to be an accurate representation of how to calculate your taxes.

Your program should ask the user if they are a single filer, or if they will be filing jointly with their spouse. If they file single, ask the user to input their total income for the year. If they file jointly then have the user enter both their income as well as their spouse’s income. (You can then add the 2 incomes together to obtain gross household income.)

Your program should also check to see if the person is eligible for the Earned Income Credit (EIC). EIC eligibility is dependent upon both filing status as well as number of dependents. Therefore, ask the user to enter how many children (dependents) they have.

Assume that if the person is eligible then the EIC deducts 8% from the gross income, so that only 92% of the gross income is now taxable. (The EIC will reduce the amount of income which is taxable, but does not change the person’s tax bracket.

Ex: If the person made $40,000 (single) then they are in the 22% bracket. The EIC makes their taxable income 40,000*0.92 = $36,800. This new total is within the 12% bracket, but the person still owes 22% of the $36,800.

Table 1 Earned Income Credit Limits

Filing Status

Income Limit if No Children

Income Limit if 1 Child

Income Limit if 2 Children

Income Limit if 3+ Children






Married Joint





Table 2 Tax Brackets for SINGLE filers

Tax Rate

Taxable Income Bracket

Tax Owed


$0 to $9,525

10% of taxable income


$9,526 to $38,700

$952.50 plus 12% of the amount over $9,525


$38,701 to $82,500

$4,453.50 plus 22% of the amount over $38,700


$82,501 to $157,500

$14,089.50 plus 24% of the amount over $82,500


$157,501 to $200,000

$32,089.50 plus 32% of the amount over $157,500


$200,001 to $500,000

$45,689.50 plus 35% of the amount over $200,000


$500,001 or more

$150,689.50 plus 37% of the amount over $500,000

Table 3 Tax Brackets for JOINT filers

Tax Rate

Taxable Income Bracket

Tax Owed


$0 to $19,050

10% of taxable income


$19,051 to $77,400

$1,905 plus 12% of the amount over $19,050


$77,401 to $165,000

$8,907 plus 22% of the amount over $77,400


$165,001 to $315,000

$28,179 plus 24% of the amount over $165,000


$315,001 to $400,000

$64,179 plus 32% of the amount over $315,000


$400,001 to $600,000

$161,379 plus 35% of the amount over $400,000


$600,001 or more

$161,379 plus 37% of the amount over $600,000

Solutions

Expert Solution

ScreenShot

Program

//Header File for input/output
#include
using namespace std;
//Function prototypes
void jointTaxCalculation();
void singleTaxCalculation();
int main()
{
   //Variable for check single or joint filing
   char ch;
   //Prompt user for type of filing
   cout << "Are you (S)ingle/(J)oint filer?";
   cin >> ch;
   //If the user choice wrong check
   while (ch != 'S' && ch != 's' && ch != 'J' && ch != 'j') {
       cout << "Are you (S)ingle/(J)oint filer?";
       cin >> ch;
   }
  
   //If joint call fuction for tax calculation
   if (ch == 'j' || ch == 'J') {
       jointTaxCalculation();
   }
   //If singlecall fuction for tax calculation
   else {
       singleTaxCalculation();
   }

    return 0;
}
//Joint calculation
void jointTaxCalculation() {
   //Variable for user input
   int dep;
   double income1, income2,totalIncome,percentage,tax;
   //Prompt user to enter income amount
   cout << "Please enter both incomes:";
   cin >> income1 >> income2;
   //Calculate total income
   totalIncome = income1 + income2;
   //Prompt for dependencies
   cout << "How many dependence(Children) you have?";
   cin >> dep;
   //According to dependency calculate EIC
   if (dep == 0) {
       percentage = 1;
   }
   else if (dep == 1) {
       percentage = .92;
   }
   else if (dep == 2) {
       percentage = .84;
   }
   else if (dep >= 3) {
       percentage = .76;
   }
   //findout tax limits and accordingly calculate tax
   if (totalIncome >= 0 && totalIncome <= 19050) {
       tax =( (totalIncome * percentage)*(10 / 100));
       cout << "As a Joint filer you fell under 10% tax bracket and you owe $" << tax << "."<    }
   else if (totalIncome >= 19051 && totalIncome <= 77400) {
       tax = (1905+(((totalIncome* percentage)- 19051 )*(12 / 100)));
       cout << "As a Joint filer you fell under 12% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 77401 && totalIncome <= 165000) {
       tax = (8907 + (((totalIncome* percentage) - 77400)*(22 / 100)));
       cout << "As a Joint filer you fell under 22% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 165001 && totalIncome <= 315000) {
       tax = (28179 + (((totalIncome* percentage) - 165000)*(24/ 100)));
       cout << "As a Joint filer you fell under 24% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 315001 && totalIncome <=400000) {
       tax = (64179 + (((totalIncome* percentage) - 315000)*(32 / 100)));
       cout << "As a Joint filer you fell under 32% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 400001 && totalIncome <= 600000) {
       tax = (161379 + (((totalIncome* percentage) - 400000)*(35 / 100)));
       cout << "As a Joint filer you fell under 35% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 600001) {
       tax = (161379 + (((totalIncome* percentage) - 600000)*(37 / 100)));
       cout << "As a Joint filer you fell under 37% tax bracket and you owe $" << tax << "." << endl;
   }
}
//Single calculation
void singleTaxCalculation() {
   //Variable for user input
   int dep;
   double income1,totalIncome, percentage, tax;
   //Prompt user to enter income amount
   cout << "Please enter your income:";
   cin >> income1;
   //Calculate total income
   totalIncome = income1;
   //Prompt for dependencies
   cout << "How many dependence(Children) you have?";
   cin >> dep;
   //According to dependency calculate EIC
   if (dep == 0) {
       percentage = 1;
   }
   else if (dep == 1) {
       percentage = .92;
   }
   else if (dep == 2) {
       percentage = .84;
   }
   else if (dep >= 3) {
       percentage = .76;
   }
   //findout tax limits and accordingly calculate tax
   if (totalIncome >= 0 && totalIncome <=9525) {
       tax = ((totalIncome * percentage)*(10 / 100));
       cout << "As a Single filer you fell under 10% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 9526 && totalIncome <= 38700) {
       tax = (952.50 + (((totalIncome* percentage) - 9525)*(12 / 100)));
       cout << "As a Single filer you fell under 12% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 38701 && totalIncome <= 82500) {
       tax = (4453.50 + (((totalIncome* percentage) - 38700)*(22 / 100)));
       cout << "As a Single filer you fell under 22% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 82501 && totalIncome <= 157500) {
       tax = (14089.50 + (((totalIncome* percentage) - 82500)*(24 / 100)));
       cout << "As a Single filer you fell under 24% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 157501 && totalIncome <= 200000) {
       tax = (32089.50 + (((totalIncome* percentage) - 157500)*(32 / 100)));
       cout << "As a Single filer you fell under 32% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 200001 && totalIncome <= 500000) {
       tax = (45689.50 + (((totalIncome* percentage) - 200000)*(35 / 100)));
       cout << "As a Single filer you fell under 35% tax bracket and you owe $" << tax << "." << endl;
   }
   else if (totalIncome >= 500001) {
       tax = (150689.50 + (((totalIncome* percentage) - 500000)*(37 / 100)));
       cout << "As a Single filer you fell under 37% tax bracket and you owe $" << tax << "." << endl;
   }

}

--------------------------------------------------------------------------

Output

Are you (S)ingle/(J)oint filer?s
Please enter your income:40000
How many dependence(Children) you have?1
As a Single filer you fell under 22% tax bracket and you owe $4453.5.


Related Solutions

Write a program that can be used to calculate the federal tax. The tax is calculated...
Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and $40,000, the tax is $2,250...
C++ Write a program that can be used to calculate the federal tax. The tax is...
C++ Write a program that can be used to calculate the federal tax. The tax is calculated as follows: for single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. the tax rates are as follows: if the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and 40,000 the tax rate...
Write a program that will calculate a 15% tip and a 13% tax on a meal...
Write a program that will calculate a 15% tip and a 13% tax on a meal price. The user will enter the meal price and the program will calculate tip, tax, and the total. The total is the meal price plus the tip plus the tax. Your program will then display the values of tip, tax, and total. Please format the output, also the round up to 2 decimal places. Write the code in python.
You are asked to write a program to help a small company calculate the amount of...
You are asked to write a program to help a small company calculate the amount of money to pay their employees. In this simplistic world, the company has exactly three employees. However, the number of hours per employee may vary. The company will apply the same tax rate to every employee. Problem Description Inputs (entered by user of the program) • Name of first employee • Hourly rate • Number of hours worked • Name of second employee • Hourly...
blue corporation owes federal income tax of $100,000 for the current year. for the last three...
blue corporation owes federal income tax of $100,000 for the current year. for the last three years it paid federal taxes of $200,000 in each year. A) is the corporation required to pay estimated taxes this year? Explain. B) If yes, what are the due dates of the payments(don't assume it's a calendar year corporation)? C) what is the minimum amount, if any the company must pay on each of those dates to avoid penalties?
Write a program to help a small company calculate the amount of money to pay its...
Write a program to help a small company calculate the amount of money to pay its employees. In this simplistic world, the company has exactly three employees. However, the number of hours per employee may vary. The company will apply the same tax rate to every employee The program must be written in Java. Prompt the user for the inputs and store the values in variables Must include all the inputs and outputs listed here and perform the calculations correctly...
Using C++ Write a program to calculate the amount a customer should pay in a checkout...
Using C++ Write a program to calculate the amount a customer should pay in a checkout counter for the purchases in a bagel shop. The products sold are bagels, cream cheese, and coffee. Use the pseudo code discussed in the class to write the program. Make reasonable assumptions about the prices of bagel, cream cheese, and coffee. Declare prices of bagel, cream cheese, and coffee as constants.
in c++ Write a program that can calculate the arithmetic mean, the geometric mean, and the...
in c++ Write a program that can calculate the arithmetic mean, the geometric mean, and the harmonic mean of a set of five numbers. •The program should ask the user to enter fiver numbers, calculate the means, and print all the data to a text file. The program should output the expected results.•Example: The text file should read: For the set of numbers {1,2,3}. The arithmetic mean is 2, the geometric mean is about 1.82, and the harmonic mean is...
1) Write a functional program in Java that can calculate the volume and surface area of...
1) Write a functional program in Java that can calculate the volume and surface area of a sphere and a cube 2) Write a procedural program in Java that can calculate the volume and surface area of a sphere and a cube 3) Write an Object Oriented Program in Java that can find the volume and surface area of a sphere and cube
Parse string java code Write a recursive program that can calculate the value of a given...
Parse string java code Write a recursive program that can calculate the value of a given polynomial in a string, which is not more than the tenth order, for the given x. The polynomial will be given in the following format and should display the value of the polynomial for spaced-out x Using index of for -/+
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT