Java programm | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Java programm

Java programm All kenyan employee earning Gross salary(basic salary +allowance)of over 11000 are subject to an income tax of 30% of basic salary.In addition the following deduction must be made 1.pension contribution of 5% basic salary 2.NHIF of 1200 for gross salary of 100,000 and above while 320 deduction for gross salary below 100,000 3. NSSF of 200 Write a program with one class and several methods performing different computation . The main {} method should contain appropriate statements that prompt the user to enter name,basic salary and house allowance it should also display the payslip as follows Employee Name: Gross pay: Tax: Pension: NHIF: NSSF: Net pay : There should be 5 different value returning methods to compute and return tax,pension,NHIF, NSSF and net pay NB; NET PAY=GROSS PAY -(TAX +PENSION+NHIF+NSSF)

28th Mar 2019, 3:52 PM
BRIAN ONSONGO ONDUKO
BRIAN ONSONGO ONDUKO - avatar
3 Answers
+ 2
first you show us your attempt then we help you 😐
28th Mar 2019, 3:57 PM
voja
voja - avatar
0
stName(String name) { lastName = name; } public String getLastName() { return lastName; } public void setmonthlySalary(double salary) { basicSalary = salary; } public double getmonthlySalary() { return basicSalary; } public double getNetS() { double netSalary; double taxRates; double tax; taxRates= 30; tax = 11000 * taxRates; netSalary = 11000 - tax; return netSalary; } public static void main(String[]args) { Scanner input = new Scanner(System.in); System.out.print("Enter a tax rate: "); double taxRate = input.nextDouble(); Employee emp = new Employee(); System.out.println(emp.getNetS(taxRate)); input.close(); } { for(i) double Basic_Salary, tax, pension, Gross_Salary,nhif,nssf; Scanner reader = new Scanner(System.in); System.out.println("Enter Basic Salary : "); Basic Salary = reader.nextDouble();
28th Mar 2019, 6:56 PM
BRIAN ONSONGO ONDUKO
BRIAN ONSONGO ONDUKO - avatar
0
Thats the attempt
28th Mar 2019, 6:56 PM
BRIAN ONSONGO ONDUKO
BRIAN ONSONGO ONDUKO - avatar