hi everyone
i havent been here in a long while since i have been here anyway, i am doing a program(practicing) but i dont or cant say if it is my calculation is off
everything is working properly except for the the income tax part. it is outputting zero. tell me what is wrong with my calculation and how do i go about fixing it. thanks much in advance.
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);