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

Publicado el: 26 febrero 2018
en el 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));
}


}

}


En esta página del sitio puede ver el video en línea error: class, interface, or enum expected java.util.Scanner de Duración hora minuto segunda en buena calidad , que subió el usuario Legendary Computer Programmer 26 febrero 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 34,676 veces y le gustó 103 a los espectadores. Disfruta viendo!