hello
im working through my book on c and im stuck at this question
Social Security (FICA) tax is currently 7.65% of earnings up to $50,400 for the year. Write a program that accepts earnings for the current week and previous cumulative earnings up to the current week, and returns the amount of FICA tax to be withheld.
Variables
CurrentEarnings
PrevEarnings
Execution
This week's pay? 700
Previous pay? 12600
FICA to withhold: $ 53.55
This week's pay? 1850
Previous pay? 50200
FICA to withhold: $ 15.30
Code:
#include <stdio.h>
float CurrentEarnings, PrevEarnings;
int main()
{
printf("This week's pay? ");
scanf("%f/n", &CurrentEarnings);
printf("Previous pay? ");
scanf("%f/n", &PrevEarnings);
CurrentEarnings += PrevEarnings;
printf("FICA to withhold: $ %2.2f", CurrentEarnings * (7.65 / 100));
}
this is what I have. I thought that I would have to add currentearnings and prevearnings and figure out the tax. from the first example result it shows $ 53.55. which is 7.65 of $700
i cant figure out what im supposed to do with this. i think the main problem is not understanding accounting. i think the question is a little weird.
any help would be great. im moving along with the other questions without to much of a problem. just every now and then there is a weird one that i don't get.
cheers, by-ee
simon