我已经多次遇到这个问题,这可能是世界上最容易解决的问题,但由于某种原因我不能。
JCreator 期望在类行上有'{',即使那里已经有一个。我试过移动它并做各种各样的事情,但我无法弄清楚。我之前通过使其不公开来修复它,但这次它没有工作。请帮忙。
import java.util.Scanner;
public class project 3 4 {
public static void main(String [] args)
{
Scanner reader = new Scanner(System.in);
int employeeID;
double regularPay;
double regularHoursWorked;
double regularMoneyEarned;
double overtimeHoursWorked;
double overtimePay;
double totalPay;
System.out.print ("Employee ID");
employeeID = reader.nextInt();
System.out.print ("Enter Wage");
regularPay = nextDouble();
System.out.print ("Enter Hours Worked");
regularHoursWorked = nextDouble();
System.out.print ("Enter Overtime Hours Worked");
overtimeHoursWorked = nextDouble();
overtimePay = 1.5 * regularPay;
regularMoneyEarned = regularPay * regularHoursWorked;
totalPay = overtimePay + regularMoneyEarned;
System.out.print ("Your total pay = " + totalPay);