Thread: cant understand the question, or is the question written incorrect.

  1. #1
    Registered User
    Join Date
    May 2014
    Posts
    23

    Talking cant understand the question, or is the question written incorrect.

    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

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,633
    With FICA anything over the limit is not taxed. So only 200 dollars would be taxed in the second example.

    Jim

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    With your question now answered (ask for clarification if needed), a few other notes.

    - It's good practice to explicitly return 0 from "main()".
    - You should not use global variables - they should be declared in "main()".
    - You don't need '\n' in your "scanf()" calls - in fact, you have the wrong slash anyway.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Google Written Test question...!
    By manasij7479 in forum General Discussions
    Replies: 15
    Last Post: 10-25-2013, 06:00 PM
  2. please help me to understand the question
    By jollykiddo in forum C Programming
    Replies: 7
    Last Post: 12-18-2011, 09:44 AM
  3. General question why must of the servers written in c and not c++ ?
    By umen242 in forum Networking/Device Communication
    Replies: 3
    Last Post: 06-26-2008, 04:17 AM
  4. I could not understand this question
    By enggabhinandan in forum C Programming
    Replies: 3
    Last Post: 10-22-2006, 05:17 AM
  5. Replies: 2
    Last Post: 01-30-2002, 10:09 PM