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));
}
}
}
На этой странице сайта вы можете посмотреть видео онлайн error: class, interface, or enum expected java.util.Scanner длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Legendary Computer Programmer 26 Февраль 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 34,676 раз и оно понравилось 103 зрителям. Приятного просмотра!