Question: Overview: In this project, you will use your programming skills to write a program that does the following: 1. Reads the contents of a file

Overview: In this project, you will use your programming skills to writeOverview:a program that does the following: 1. Reads the contents of a

In this project, you will use your programming skills to write a program that does the following:

1. Reads the contents of a file called "taxdata.txt"

2. Create a class called Taxpayer to store and keep track of each individual taxpayer

3. Store the data in a single list of Taxpayers

4. Write to a file called "taxesdue.txt" that contains each Taxpayer's name, social security number, and the remaining amount they owe (rounded to the nearest cent). The file should be formatted in organized columns and the entries should be sorted by the remaining tax owed.

In order to do this assignment, you must create a user-defined class called Taxpayer. The class definition and member function definitions should be contained in a single file called Taxpayer.h. IMPORTANT: for this assignment, you are turning in two files: the class definition Taxpayer.h, as well as hw6.cpp, the source file that creates your program. You do NOT turn in any text files! We will test your program on our own version of "taxdata.txt".

Details:

Taxpayer class details:

Taxpayer class should hold private variables for: social security number (stored as an int), last name and first name (stored as strings), filing status (stored as a bool), and gross income and taxes paid (stored as doubles). You are free to use any additional private variables if you would like.

It should have a default constructor as well as a regular constructor so that each of the above private variables may be set.

It should have any accessor or mutator member functions necessary for the assignment. It should have an overloaded operator to compare remaining taxes owed of two Taxpayers. (payer1

In order to do the above operator overload, your Taxpayer class should have built within it a way to compute the total tax owed according to the gross income of the individual. The implementation details are left up to you, but you should follow good programming practices as outlined in class. Taxes should be computed according to the following basic tax tiers:

For Taxpayers filing with single status:

1. If the gross income is above $0 and no larger than $37,650, the taxpayer owes a total of 15% of his/her gross income.

2. If the gross income is above $37,650 and no larger than $91,150, the taxpayer owes a total of 25% of his/her gross income.

3. If the gross income is above $91,150, the taxpayer owes a total of 28% of his/her gross income.

For Taxpayers filing with married status:

1. If the gross income is above $0 and no larger than $75,300, the taxpayer owes a total of 15% of his/her gross income.

2. If the gross income is above $75,300 and no larger than $151,900, the taxpayer owes a total of 25% of his/her gross income.

3. If the gross income is above $151,900, the taxpayer owes a total of 28% of his/her gross income.

The remaining tax owed of each Taxpayer is the difference between his/her total tax owed and taxes paid. (Note that this number could be negative, which would indicate that that Taxpayer is owed a tax refund.)

Note: When working on this assignment in the PIC Lab, you should be sure to store your project in your own personal Z: directory, NOT on the desktop. The file read/write operations will not work correctly if your project is not in Z:.

taxdata.txt details:

The file "taxdata.txt" contains a listing for each person on its own line. Data is given in the following order with a space between entries: social security number, last name, first name, filing status ("s" for single, "m" for married), gross income, taxes paid. An example file is provided.

Sample run:

An example of the input file "taxdata.txt" and corresponding output file "taxesdue.txt" are provided. Note that your code must be able to adapt to different contents of the file "taxdata.txt" (including a possibly different number of entries). The format of the entries will remain the same.

Submission:

As noted above, this submission requires two files: Taxpayer.h, and hw6.cpp. (You should not provide the text files -- we will test your program on our own text file!) If your files are not named and submitted exactly like this, your homework will not be graded. Your code should contain useful comments as well as your name, the date, and a brief description of what the program does. Your grade will not only depend on your program running successfully and providing correct output -- it will also depend on readability and good programming practices followed in your code (including encapsulation). Upload your files to the CCLE website. The files will be automatically collected at date and time described in the submission summary below.

taxdata (1).txt 1656666666 Barrymore Christina s 55212 1022.66 222353222 Doe Jane m 22352.10 212.55 333535333 Simpson Homer m 49212. 12 11542.22 111111111 Smith Tim s 23550211. 12 2055. 21 700009000 Coen Seymour s 90222 100 787878787 Daniels Beryl m 10335.22 368.22 999999999 McDonald Ronald s 655502.26 1252.22

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!