Can I use these codes in Netbeans? Can someone give me the codes to be typed in Netbeans 8.2?
Answer:
Yes, u can use this code in Netbeans. See below I have given the Input and Output method with a screenshot.
Source Code:
package test;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
String fname, lname;
Double hrsworked, payrate, income, fnfp, paye, fiji, medical=6.50, total_deduction, netpay;
Scanner sc = new Scanner(System.in);
System.out.print("\nEnter Employee First Name: ");
fname = sc.nextLine();
System.out.print("\nEnter Employee Last Name: ");
lname = sc.nextLine();
System.out.print("\nEnter Employee Hourse Worked: ");
hrsworked = sc.nextDouble();
System.out.print("\nEnter Employee Pay Rate: ");
payrate = sc.nextDouble();
income = hrsworked * payrate;
fnfp = income * 0.085;
paye = income * 0.065;
fiji = income * 0.0285;
total_deduction = fnfp + paye + medical;
netpay = income - total_deduction;
System.out.printf("\n*----------* Pay Slip for: %s *----------*\n", (fname + " " + lname));
System.out.printf("Fortnightly Income: $ %.2f\n", income);
System.out.printf("Hourse Worked: $ %.2f\n", hrsworked);
System.out.printf("FNPF: $ %.2f\n", fnfp);
System.out.printf("PAYE: $ %.2f\n", paye);
System.out.printf("Fiji Care Tax: $ %.2f\n", fiji);
System.out.printf("Medical Insurence: $ %.2f\n", medical);
System.out.printf("Total Deduction: $ %.2f\n", total_deduction);
System.out.printf("Net Pay: $ %.2f\n", netpay);
System.out.printf("\n");
}
}
Output:
Step by step
Solved in 2 steps with 7 images