Question: In C++ Programming: For this task we will create a class with some functions that will support our class which holds the annual income and

In C++ Programming:

For this task we will create a class with some functions that will support our

class which holds the annual income and tax rate for from 1 to many tax

payers. We will also 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 ).

So here is a decomposition of what is to be done for this task:

Define a class called TaxPayer that contains the tax payer information:

the tax rate, the income, and the taxes (all floats).

The taskE driver will create a dynamic array for these objects, called

citizen, using SIZE again as the size for the allocation. Notice how the

constructor works for arrays of objects.

Create a function called taxTaker that will accept a pointer to the array

of objects as a parameter. This function will take (actually, it will be

generated via the random function) user information for each payer,

up to the size of the array of structures. The function should create a

randomly generated income value between 5000.00 and 50000.00,

and another randomly generated tax rate between 0.01 through 9.9,

populate the object with those values and then store the computation

in the taxes element. Use rand() and properly seed... This function

should also use standard input validation and make sure it falls with

the range of, and income amounts are otherwise valid numbers.

Create a function called taxPrint that will accept a pointer to the array

of objects as a parameter input and print out the total taxes due for all

the payers in the array to standard output. The tax payer ID should be

the subscript values. Make sure you format the output and print for

each payer, up to the size.

This code is used:

// PLACE ALL OF THIS PROGRAM'S prototypes and Declarations here and comment your code.

// PLACE prototypes and Declarations HERE FOR TASK E // *************************************************

void taskE() {

TaxPayer *citizens = new TaxPayer[SIZE]; taxTaker(citizens); taxPrint(citizens);

cout << "end of task E" << endl; cin.get(); }

// PLACE CODE HERE FOR TASK E // ************************************************* // TASK E CODE

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!