Question: C++ program using a vector of structures. This program uses a vector of structs to take tax info. from two citizens and yield their tax

C++ program using a vector of structures.

This program uses a vector of structs to take tax info. from two citizens and yield their tax results for the year. I think I'm close but I'm getting errors. Here is what I have so far. Instead of

rewriting the program from scratch, please try to fix the code below. Thanks.

(Lines 1-50)

C++ program using a vector of structures. This program uses a vector

(Lines 50-90)

of structs to take tax info. from two citizens and yield their

(Code to paste)

#include #include #include

using std::cin; using std::cout; using std::endl; using std::vector;

const int SIZE = 2; void taxPrint(citizen); //prototypes void taxTaker(citizen);

struct taxPayer { float taxRate; float income; float taxes; };

int main() { std::cout citizen; //vector of type struct taxTaker(citizen); //two functs pass citizen vector taxPrint(citizen); return 0; }

void taxTaker(vector) //funct that gathers info. { struct taxPayer payer; bool controlFlag1 = true; bool controlFlag2 = true;

for (int i = 1; i

std::cout > payer.income;

if ((cin.fail()) || payer.income ::max(), ' '); } else { controlFlag1 = false; }

} while (controlFlag1);

std::cout > payer.taxRate;

if ((cin.fail()) || (payer.taxRate 9.9)) //tax rate validation { cout ::max(), ' '); } else { controlFlag2 = false; }

} while (controlFlag2);

payer.taxes = (payer.income * payer.taxRate)/100 citizen.push_back(payer);

}

}

void taxPrint(vector) //print funct { std::cout

for (int j = 1; j finclude #include limits sing std::endi: 10 11void taxPrint cicizen): const int SIZE-2; 13 17 float income 21 std::cout : :n .x(), ' '}; 51 contr01 Flag 1 = false 53 while (controlFlag1); 56 std ! !cont

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!