Can I use these codes in Netbeans? Can someone give me the codes to be typed in Netbeans 8.2?
![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("Enter Employee Last Name: ");
Iname = sc.nextLine();
System.out.print("Enter Employee Hours Worked: ");
hrsworked = sc.nextDouble( );
System.out.print("Enter Employee Pay Rate: ");
payrate = sc.nextDouble( );
income - hrsworked * payrate;
fnfp = income*8.085;
paye = income*0.065;
fiji = income*8.0285;
total deduction = fnfp + paye + fiji +medical;
netpay = income-total_deduction;
System.out.printf("\n+----
%3D
-* Pay Slip for: s
*\n", (fname+"
*+Iname));
System.out.printf("Fortnightly Income: $ %.2f\n",income);
System.out.printf("Hours 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 Insurance: $ $.2f\n*, medical);
System.out.printf(*Total Deduction: $ 4.2f\n", total_deduction);
System.out.printf("Net Pay: $ .2f\n*, netpay);
System.out.printf("\n");](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F279deb2d-d456-49c4-b10c-7ce375184d3c%2F3aa0351f-6675-4012-98b5-9878f4ce7482%2F0hx1vvr_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)