CSC133 Introduction to CS Using C++
Lab 4

Part I

Tuition for students at MCC is based on the number of credits taken. It also depends on whether one is a Middlesex County resident or not. In this part of the lab you will write a program to calculate tuition. The rules for tuition charges are:

If you live in Middlesex County, the cost of attending MCC is $ 81.55 tuition per credit plus $ 24.50 fees per credit.
If you live outside of Middlesex County, the cost of attending MCC is $163.10 tuition per credit plus $ 51.00 fees per credit.

Your program will have the following input:

Your program will print the following:

In writing your program, create the following functions:

Part II

In this part of the lab you will write a program that will calculate the amount of income tax owed at the end of the year. The program will also print a message with the amount of the tax refund or the tax still owed.

During the year, income tax is withheld from each paycheck. At the end of the year, you must calculate the actual amount of income tax which you owe. If the amount withheld is greater than your actual income tax, then the IRS will send you a refund check. But if the amount withheld is less than your actual income tax, then you must send an additional payment to the IRS to cover the rest of your income tax.

There are several steps in the calculations required. The amount of tax owed depends on how much you earned, but also on how many dependents you claim (how many people you are responsible for supporting). You get an exemption (a portion of your income that is not taxable) which is based on the number of dependents you claim.

Your program will have the following input:

Your program will print the following:

To calculate the tax owed, first calculate the total exemption amount by multiplying the number of dependents by the personal exemption, which is 4000. Next calculate the taxable income by subtracting the total exemption amount from the total income. To calculate the income tax owed, multiply the taxable income by the tax rate. If the taxable income is between 0 and 29000, the tax rate is 15%. If the taxable income is between 29001 and 79000, the tax rate is 24%. If the taxable income is over 79000, the tax rate is 31%. (These are not the actual tax rates in effect at this time.)

It is possible that the amount of tax withheld is less than the income tax owed. In that case, you must send in an additional tax payment so that the additional payment and the amount of tax withheld is equal to the income tax owed. If this is the case, print a message saying that additional tax is owed, and include the amount owed in the message. Otherwise the taxpayer will receive a refund of the extra tax withheld. If this is the case, print a message saying that there will be a refund, and include the amount of the refund in the message.

In writing your program, create the following functions:

I want you to use the following good programming practices for both of your programs:


Email Me | Office Hours | My Home Page | Department Home | MCC Home Page

© Copyright Emmi Schatz 2002