error: class, interface, or enum expected java.util.Scanner

Publicado em: 26 Fevereiro 2018
no canal de: Legendary Computer Programmer
34,676
103

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));
}


}

}


Nesta página do site você pode assistir ao vídeo on-line error: class, interface, or enum expected java.util.Scanner duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Legendary Computer Programmer 26 Fevereiro 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 34,676 vezes e gostou 103 espectadores. Boa visualização!