like and subscribe!
try it out yourself with unfixed code:
java.util.Scanner; //initialize scanner
public class Main // defines class name
{
public static void main(String[] args) {
// create Scanner to obtain input from command window
Scanner input = new Scanner(System.in);
double hours; // number of hours worked input
double pay; // rate of hourly wage input
double overtime; // used to calculate overtime
double overtimePay;
// First input is for employee #1
System.out.print("Enter the number of regular hours the employee Worked "); // prompt for user input
hours = input.nextDouble();
System.out.print("Enter the number of overtime hours the employee worked "); //
overtime = input.nextDouble();
System.out.print("Enter the payrate of the employee "); // prompt for user input
pay = input.nextDouble();
System.out.print("Enter the overtime payrate of the employee "); // prompt for user input
overtimePay = input.nextDouble();
if (overtime == 0)
System.out.printf("Gross pay for the employee is %.2f\n", hours * pay);
// print to screen results
else {
System.out.printf("Gross pay for the employee is %.2f\n", (hours * pay) +
(overtime * (pay * overtimePay)));
System.out.printf("overtime pay for the employee is %.2f\n", (overtime * (pay * overtimePay)));
System.out.printf("regular pay for the employee is %.2f\n", (hours * pay));
}
}
}
On this page of the site you can watch the video online error: class, interface, or enum expected java.util.Scanner with a duration of hours minute second in good quality, which was uploaded by the user Legendary Computer Programmer 26 February 2018, share the link with friends and acquaintances, this video has already been watched 34,676 times on youtube and it was liked by 103 viewers. Enjoy your viewing!