faith jp


{ City } nairobi
< Country > kenya
* Profession * student
User No # 124659
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 0
Users Marked my Answers as Wrong # 1
Questions / { faith jp }
Questions Answers Category Views Company eMail




Answers / { faith jp }

Question { 1160 }

c program to compute Income tax and Net Salary for its employees. The company offers tax relief of Kshs. 650 for single employees and Kshs. 1,100 for married employees. The relief will be deducted from the Gross salary, to give the taxable income. This will be computed at the following rates: [10mks]
Taxable Income Rate (%)
<5000 0
5000-19999 6
20000-36999 9
37000 and above 16


Answer

#include

main ()
{
char employee_name, marital_status;
int employee_no;
float taxable_income, gross_income, tax, net_salary;

printf ("
Enter Employee Name:");
scanf ("%s", &employee_name);
printf ("
Enter Employee Number:");
scanf ("%d", &employee_no);
printf ("
Enter Employee marital status:");
scanf ("%s", &marital_status);
printf ("
Enter Employee Gross income:");
scanf ("%f", &gross_income);

if (marital_status == Married)
if (taxable_income < 5000)
tax = (gross_income - 1100) * 0.00;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 5000 && taxable_income < 19999)
tax = (taxable_income - 1100) * 0.06;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 20000 && taxable_income < 36999)
tax = (gross_income - 1100) * 0.09;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 37000)
tax = (taxable_income - 1100) * 0.16;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
else if (marital_status == NotMarried)
if (taxable_income < 5000)
tax = (gross_income - 650) * 0.00;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 5000 && taxable_income < 19999)
tax = (taxable_income - 650) * 0.06;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 20000 && taxable_income < 36999)
tax = (gross_income - 650) * 0.09;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 37000)
tax = (taxable_income - 650) * 0.16;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
return 0;
}

Is This Answer Correct ?    0 Yes 1 No