I'm writing a program that computes federal income taxes. It checks for four different filing status's then asks for your taxable income. After this all the calculations are done, then BAM, results.
My trouble right now is getting it compiled. I'm using a switch statement (per teachers instructions) for the four different filing status's. I've written up the first case and wanted to run some numbers, but can't get it to compile.
Can anyone help me sort out what is going wrong?
If the calculations look confusing here is the logic behind them:
"For each filing status there are six tax rates. Each rate is applied to a given amount of the taxable income. For example, for a taxable income of $450,000 for a single filer, $7,550 is taxed at 10%, ($30,650-$7,550) at 15%, ($74,200-$30,650) at 25%, ($154,800-$74,200) at 28%, ($336,550-$154,800) at 33%, and ($450,000-336,550) at 35%."
I hope did the calculations right :/
All help is greatly appreciated, I really thank you guys.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
#include <iostream>
using namespace std;
int main()
{
int statusCode;
float taxableIncome;
float taxAMT;
float bracketOne;
float bracketTwo;
float bracketThree;
float bracketFour;
float bracketFive;
float bracketSix;
//do/while statement for input of statusCode
do
{
cout << "Please enter your Status Code." << endl
<< "(1) If single" << endl
<< "(2) If married and filing jointly" << endl
<< "(3) If married and filing separately" << endl
<< "(4) If the head of a household" << endl
<< "Your Status Code: ";
cin >> statusCode;
if (statusCode < 1 || statusCode > 4)
cout << "You must enter a correct Status Code." << endl << endl;
}
while (statusCode < 1 || statusCode > 4);
//do/while statement for input of taxableIncome
do
{
cout << "Please enter your total taxable income: ";
cin >> taxableIncome;
if (taxableIncome < 0)
cout << "Input a proper amount, k thx" << endl;
}
while (taxableIncome < 0);
//switch to control the four cases (1)single (2)married and filing jointly
//(3)married and filing separately (4)head of a household
switch (statusCode)
{
case 1 : if(taxableIncome < 7550)
bracketOne = (taxableIncome)(.10);
else
bracketOne = (7550)(.10);
if(taxableIncome > 7551 && taxableIncome < 30650)
bracketTwo = (taxableIncome - 7550)(.15);
if(taxableIncome > 30650)
bracketTwo = (30650-7550)(.15);
if(taxableIncome > 30651 && taxableIncome < 74200)
bracketThree = (taxableIncome - 30650)(.25);
if(taxableIncome > 74200)
bracketThree = (74200 - 30650)(.25);
if(taxableIncome > 74201 && taxableIncome < 154800)
bracketFour = (taxableIncome - 74200)(.28);
if(taxableIncome > 154800)
bracketFour = (154800 - 74200)(.28);
if(taxableIncome > 74201 && taxableIncome < 336550)
bracketFive = (taxableIncome - 154800)(.33);
if(taxableIncome > 336550)
bracketFive = (336550 - 154800)(.33);
if(taxableIncome > 336551)
bracketSix = (taxableIncome - 336550)(.35);
break;
default : cout << "I think I need a defualt statement right?" << endl;
}
//Just a test to see what the numbers all look like:
cout << bracketOne << " " << bracketTwo << " " << bracketThree
<< " " << bracketFour << " " << bracketFive << " " << bracketSix << endl;
//End of program stuff
system("pause");
return 0;
}
|
Here is the error message:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
1
|
1> Source.cpp
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(54): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(56): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(59): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(62): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(65): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(68): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(71): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(74): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(77): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(80): error C2064: term does not evaluate to a function taking 1 arguments
1>c:\users\william\documents\visual studio 2012\projects\midterm\midterm\source.cpp(83): error C2064: term does not evaluate to a function taking 1 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|