hi all
I am doing this program. I manage to get everything to be working correctly except for the income tax part. what do i have to do in order to calculate the income tax for the output to show how much income tax on the user payslip.
i tried everything but i am still getting a zero output. tell me what to do and how to go about gettin the calculation correctly
otherwise everything else is working properly . here is my code
final double health_surcharge = 33.50;
double hrs, hrswrk, gsalary = 0, NIS,nsalary=0, rate_of_pay = 0,totaldeduct = 0, incometax, teaching_allow;
double overtime = 0, income_tax = 0, total_tax;
System.out.println("please enter the lecturer id number");
String lecturerID = userinput.nextLine();
System.out.println("please enter the lecturer first name");
String firstname = userinput.next();
System.out.println("please enter the lecturer last name");
String lastname = userinput.next();
System.out.println("please enter the number of hours work");
hrswrk = userinput.nextDouble();
System.out.println("please enter the teaching allowance");
teaching_allow = userinput.nextDouble();
System.out.println("please enter your NIS contribution");
NIS = userinput.nextDouble();
hrs = (hrswrk * rate_of_pay) + teaching_allow;
hrs = (overtime * rate_of_pay);
total_tax = (health_surcharge + NIS) + (gsalary * 0.5);
total_tax = (gsalary * 0.5);
gsalary = (gsalary + teaching_allow);
totaldeduct =(NIS + health_surcharge);
nsalary = (gsalary - totaldeduct);
System.out.println("the lecturer id is "+ lecturerID);
System.out.println("the lecturer first and last name is "+ firstname +lastname);
System.out.println("the hours worked is "+ hrswrk);
System.out.println("the income tax is "+income_tax);
System.out.println("the total deduction is "+totaldeduct);
System.out.println("the gross salary is "+gsalary);
System.out.println("the net salary is "+nsalary);

