yes thanks that works but i have one last problem i have to calculate federal tax and i've been trying to figure out a formula for awhile now.

Code:

Federal tax (FT) is deducted from gross pay. FT is calculated
based on what a person would earn for a full year, assuming that
the employee will make the current week's gross pay every week
for a full 52 weeks. The rates are:
o 16% on the first $20,000 earned annually
o 23% on the next $20,000 earned annually
o 29% on the remainder earned annually
Provincial Tax (PT) is collected by the Federal Government in
all provinces (except Quebec, which we will ignore for the
purposes of this assignment). PT is calculated at 47% of the
Federal tax, and is simply added to FT.
An example of a gross weekly pay of $598.50 would be calculated
as an annual pay of $31,122 (598.50 * 52), which will result in
a total FT (including PT) of $162.78
((20,000 * 0.16 + 11,122 * 0.23) / 52 * 1.47).

if anyone can give me some pointers (no a programming pointer) on how i could do this?

the way tried is way to hard to explain though i have a bit of the code left

Code:

double cFT(double gross) {
double annual = 0, ft16, ft23 = 0, ftremain = 0, ft;
annual = gross * 52;
ft16 = annual - 20000;
if (ft16 > 20000) {
ft23 = ft16 - 20000;
ft16 = 20000;
ft23 = ft16 - 20000
ftremain = ft23
ft = (

it was giving me off numbers like some where negatives so just seeing if someone can help with a new formula to figure this out.