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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started