Hello tbirdlx89,
Please edit your original post and use code tags. Without them, your code is hard to read, and it makes people less likely to help you. It helps us tremendously because we can easily identify code line numbers and view your code with proper formatting.
How to use code tags:
http://www.cplusplus.com/articles/jEywvCM9/
At a cursory glance, I can see the following problems with your code:
1.) The only reason
std:string
doesn't come up as an error is because of
using namespace std;
- It will compile but it is technically incorrect - The scope resolution operator is a double colon, and should therefore be
std::string
.
2.) The same is true for
std:int
which would become
std::int
, but that's not a valid type in the std namespace anyway.
3.) There's several problems with this for-loop control structure:
for (int i = 0; i < filingStatus[4]); i++;)
. You have an unnecessary (and wrong) trailing closing parenthesis as well as a semi-colon. Those should be removed. In addition, you're comparing an integer (
int i
) with a std::string (
filingStatus[4]
). I'm sure what you meant to do was
for(int i =0; i < 4; i++)
- even then the use of a "magic number" such as four is not encouraged. I suggest a constant integer to represent the size of the array:
1 2 3 4 5 6
|
const int num_status_strings = 4;
std::string filingStatus[num_status_strings] = {/*...*/}
for(int i = 0; i < num_status_strings; i++) {
/**/
}
|
EDIT - I popped your code into my IDE, I see a lot of unmatched brackets and logical errors. It may sound like a large task, but I suggest starting over, which I'm prepared to help you with.
I've made a little template for you to start out with. I was able to deduce some of the parameters for your functions based on the code you provided, though I'm sure the function signatures aren't quite complete yet. The functions also don't do anything so far. If you have any questions feel free to ask - If you can tell me more about what you're envisioning (such as the flow of the program or what results you're expecting), then I'll be able to help you more. Hope this helps.
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
|
#include <iostream>
#include <string>
int getStatusCode() {
/**/
}
float getTaxIncome(/**/) {
/**/
}
float getTaxAmount(int _code, float _taxable) {
/**/
}
void displayResults(/**/) {
/**/
}
int main(int argc, char* argv[]) {
int status_code = getStatusCode();
float tax_income = getTaxIncome(/**/);
float tax_amount = getTaxAmount(status_code, tax_income);
displayResults(/**/);
//"Pause" the program
return 0;
}
|