In LEL, the tax treatment of earned income is different from the tax treatment of unearned income such as capital gains, interest and dividends.
For earned income, there is a "standard deduction-earned" of 1000 LELn Dollars (LE$). Earned income above that amount is taxed at 25%.
For unearned income, there is a "standard deduction-unearned" of 2000 LE$. Unearned income above that amount is taxed at 20%.
The task is to write a program to compute the tax to be paid by a taxpayer, given the taxpayer's amount of earned income and amount of unearned income. The program will use a function to compute tax on an amount, given the amount, the deduction, and the rate. The function will be called twice: once for earned income and once for unearned income.
Before proceeding further, you should construct some test data by doing some tax computations manually. That way, you will be sure that you understand the tax computation procedure. Here are some cases to use. After you have computed the tax in these cases manually, check your work against the correct answers in the right (Tax) column. Be sure you understand how each number in the Tax column was computed! Then work out a couple of additional test cases of your own.
Test Case No. Earned Income (LE$) Unearned Income (LE$) Tax (LE$)
1 500 1500 0
2 500 2500 100
3 1500 1500 125
4 1500 2500 225
5 1740 2250 235
6 437 2250 50
7 1760 100 190
As in previous assignments, you will start with an Assignment Template, which you can find attached as Assignment4Template.cpp. In that file, you will see that most of the program has been written for you. You will fill in the missing parts, compile the program, and test it using the test data above. Missing parts are indicated by ?????.
One final note: It should not be necessary for you to change anything in the template other than the ????'s. If you do feel an overwhelming urge to change anything else, please post a note in this week's conference explaining why you feel that urge, and let's discuss it!