Like Tree1Likes
  • 1 Post By claudiu

Can someone help please :)

This is a discussion on Can someone help please :) within the C Programming forums, part of the General Programming Boards category; Create a program that will compute the monthly Net Pay of an employee. The user will type the no. of ...

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    1

    Can someone help please :)

    Create a program that will compute the monthly Net Pay of an employee. The user will type the no. of hours worked and the hourly rate of the employee. The program will deduct 3% for SSS, 11%for tax and P25.00 for health insurance display the gross pay, individual deduction and the weekly net pay of the employee */

    Given:
    float hours_worked,rate,sss,tax,health,gpay,npay;


    I really gets confused most of the time.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,268
    What have you tried?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Sounds simple enough....
    Just set yourself down with a pencil, paper and nice hot coffee and work it out step by step...
    Become the process... what do you need to do first? Then what next? until you've got it sorted.
    Then once you understand the problem you can start sorting out the C code for it.
    Once you're confident you have a solution, take half an hour off and then...
    Are you ready...???
    Start writing code.

    Yep... writing code is always the second last thing a programmer does.

    As I'm want to say... There is no programmer on earth who can code a solution to a problem he doesn't understand.

  4. #4
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by CommonTater View Post
    Sounds simple enough....
    Just set yourself down with a pencil, paper and nice hot coffee and work it out step by step...
    Become the process... what do you need to do first? Then what next? until you've got it sorted.
    Then once you understand the problem you can start sorting out the C code for it.
    Once you're confident you have a solution, take half an hour off and then...
    Are you ready...???
    Start writing code.

    Yep... writing code is always the second last thing a programmer does.

    As I'm want to say... There is no programmer on earth who can code a solution to a problem he doesn't understand.
    Yes, the last thing a programmer does is to use the most used key in programming: delete.

    Then he starts over again, until he gets it right.
    mike65535 likes this.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by claudiu View Post
    Yes, the last thing a programmer does is to use the most used key in programming: delete.

    Then he starts over again, until he gets it right.
    LOL... Yours is better than mine... I was thinking the last thing would be: "Fixing their own f___ ups".

  6. #6
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,676
    Quote Originally Posted by CommonTater View Post
    As I'm want to say... There is no programmer on earth who can code a solution to a problem he doesn't understand.
    But if you put enough monkeys in front of enough keyboards, you might just have a chance...

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21