0

i've gotten this problem multiple times and it's probably the easiest thing in the world to fix, but for some reason I can't.

JCreator expects '{' on the class line, even though there's one there already. I've tried moving it and doing all sorts of things, but I can't figure it out. I fixed it before by making it not public, but it didn't work this time. Please help.

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);
1
  • 2
    Aren't you missing closing tag at the end? }, also that's not JavaScript. Commented Oct 9, 2013 at 15:46

2 Answers 2

3

That line should be public class project34 { or public class project {. JCreator is probably getting tripped up by the space

Sign up to request clarification or add additional context in comments.

Comments

0

your class name contains spaces which is not valid:

public class project 3 4 {

try changing it to:

public class project34 {

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.