Share
Explore BrainMass

function to calculate taxes

Write a function calculateTaxes () that calculates and returns the amount of city incom tax and the amount of federal income tax to be withheld from an employee's pay for one pay period. Assume that city income tax withheld is computed by taking 1.15 percent of gross pay on the first $40,000 earned per year and that federal income tax withheld is computed by taking the gross pay less $50 for each dependent claimed and multiplying by 20 percent.
Use this function in a program that for each of several employees reads the employee's number, number of dependents, hourly pay rate, city income tax withheld to date, federal income tax withheld to date, and hours worked for this period and then calls function calculateTaxes () to find the amount of taxes to be withheld. The program should then display the employee number, gross pay and net pay for this period, the amount of city income tax and the amount of federal income tax withheld for this period, and the total amounts withheld through this pay period.

Solution Summary

Write a function calculateTaxes () that calculates and returns the amount of city incom tax and the amount of federal income tax to be withheld from an employee's pay for one pay period.

$2.19