Question: Change the following code using JOptionPane header instead of Scanner. import java.util.Scanner; public class PayrollTest { public static void main(String[] args) { Scanner sc1=new Scanner(System.in);

Change the following code using JOptionPane header instead of Scanner.

import java.util.Scanner;

public class PayrollTest {

public static void main(String[] args) { Scanner sc1=new Scanner(System.in); Scanner sc=new Scanner(System.in); while(true) { System.out.print("Enter the Name of an Employee ::"); String name=sc.nextLine(); System.out.print("Enter the Employee ID ::"); int id=sc1.nextInt(); System.out.print("No of Hours Employee Worked ::"); int noOfHours=sc1.nextInt(); System.out.print("Hourly Pay Rate for an Employee ::"); int payRate=sc1.nextInt(); Payroll pr=new Payroll(name,id,noOfHours,payRate); if(pr.count==0) {continue;} else { System.out.println(pr.toString()); System.out.println("* PROGRAM EXIT *");break;} }

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!