You are on page 1of 9

/*ESQUIVEL, J.

esquivelazzej@yahoo.com*/

/*PROBLEM: Make a program that will compute for the net income of a particular employee. You have
to accept name, position, and number of hours worked. The position has three (3) categories; Manager
rate per hour P500; if supervisor rate per hour is P400; if employee rate per hour is 300.Then after
accepting the number of hours worked.

for the bonus

if gross >= 8000 bonus = 1000

gross >= 5000 bonus = 750

gross >= 3000 bonus = 0

then compute for the deduction

sss = 10%

Medical = 100

tax

gross >= 7000 tax is 15%

gross >= 4000 tax is 10%

gross >= 2000 tax is 5%

then compute for the net income

gross + bonus - total deduction; then display the net income*/


/*CODE*/

#include <stdio.h>

int a, b, c, d, e;

float z, y, x, w, v;

main ()

clrscr ();

printf ("\n Enter Name: ");

scanf ("%s",&a);

printf ("\n \n <1> Manager <2> Supervisor <3> Employee \n\n");

printf (" Enter Position: ");

scanf ("%s",&b);

switch(b)

case '1':

printf ("\n \n Rate: P500.00");

printf ("\n \n No. of hours worked: ");

scanf ("%d",&c);

d=c*500;

printf ("\n Gross: %d",d);


if(d>=8000)

printf ("\n \n Bonus: 1000");

else if(d>=5000 && d<=7999)

printf ("\n \n Bonus:750");

else if(d>=0 && d<=4999)

printf ("\n \n Bonus:0");

printf ("\n \n \n Deduction:");

y=d*0.1;

printf ("\n \n SSS: %0.2f",y);

x=100;

printf ("\n \n Medical: %0.2f",x);

printf ("\n \n Tax: ");

if(d>=7000)

z=d*0.15;

printf ("%0.2f",z);

}
else if(d>=4000 && d<=6999)

z=d*.1;

printf ("%0.2f",z);

else if(d>=0 && d<=3999)

z=d*0.5;

printf ("%0.2f",z);

w=x+y+z;

printf ("\n \n Total Deduction: %0.2f",w);

v=d+e-w;

printf ("\n \n \n NET INCOME: %0.2f",v);

break;

case '2':

printf ("\n \n Rate: P400.00");

printf ("\n \n No. of hours worked: ");

scanf ("%d",&c);

d=c*400;

printf ("\n Gross: %d",d);


if(d>=8000)

printf ("\n \n Bonus: 1000");

else if(d>=5000 && d<=7999)

printf ("\n \n Bonus:750");

else if(d>=0 && d<=4999)

printf ("\n \n Bonus:0");

printf ("\n \n \n Deduction:");

y=d*0.1;

printf ("\n \n SSS: %0.2f",y);

x=100;

printf ("\n \n Medical: %0.2f",x);

printf ("\n \n Tax: ");

if(d>=7000)

z=d*0.15;

printf ("%0.2f",z);
}

else if(d>=4000 && d<=6999)

z=d*.1;

printf ("%0.2f",z);

else if(d>=0 && d<=3999)

z=d*0.5;

printf ("%0.2f",z);

w=x+y+z;

printf ("\n \n Total Deduction: %0.2f",w);

v=d+e-w;

printf ("\n \n \n NET INCOME: %0.2f",v);

break;

/*ESQUIVEL, J. P

esquivelazzej@yahoo.com*/
case '3':

printf ("\n \n Rate: P300.00");

printf ("\n \n No. of hours worked: ");

scanf ("%d", &c);

d = c*300;

printf ("\n Gross: %d", d);

if(d>=8000)

printf ("\n \n Bonus: 1000");

else if(d>=5000 && d<=7999)

printf ("\n \n Bonus:750");

else if(d>=0 && d<=4999)

printf ("\n \n Bonus:0");

printf ("\n \n \n Deduction:");

y=d*0.1;

printf ("\n \n SSS: %0.2f",y);

x=100;

printf ("\n \n Medical: %0.2f",x);


printf ("\n \n Tax: ");

if(d>=7000)

z=d*0.15;

printf ("%0.2f",z);

else if(d>=4000 && d<=6999)

z=d*.1;

printf ("%0.2f",z);

else if(d>=0 && d<=3999)

z=d*0.5;

printf ("%0.2f",z);

w=x+y+z;

printf ("\n \n Total Deduction: %0.2f",w);

v=d+e-w;

printf ("\n \n \n NET INCOME: %0.2f",v);

break;
default:

printf ("\n Invalid!");

getche();

You might also like