Question: For the assignment, we will create a program that will take the annual income and tax rate for from 1 to many tax payers, and

For the assignment, we will create a program that will take the annual income and tax rate for from 1 to many tax payers, and compute each payers amount of taxes that are due for the year. The amount is calculated by taking each payers income, multiply it by the tax rate, yielding their taxes ( taxes = income * taxRate ).

Here is the decomposition of tasks:

Create a structure that contains the tax payer information, the tax rate, the income, and the taxes (all floats).

Create a vector of these structs, called citizen.

Create a function called taxTaker that will accept the structure as a parameter. This function will take user information for each payer, up to the size of the vector of structures. The function should take the inputs for the income and the tax rate elements, and then store the computation in the taxes element. This function should also use standard input validation and ensure the data is good (numeric), and that it falls with the range of 0.01 through 9.9 for rate, and income amounts are greater than zero.

Create a function called taxPrint that will accept the structure as a parameter input and print out the total taxes due for all the payers in the vector to standard output. Make sure to format the output in accord with the sample output below. The output should be for dollar amounts. This will print for each payer, up to the size.

The following is your driver program. Follow the naming accordingly: #include

const int SIZE = 2;

void taxPrint(taxPayer *); void taxTaker(taxPayer *);

int main() { std::vector citizen; taxTaker(citizen); taxPrint(citizen); return 0; }

// create your functions

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!