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)
(Lines 50-90)
(Code to paste)
#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
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 for (int j = 1; j finclude
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started