Payroll Program Assistance

I need help with my payroll program which is for my Java class. The assignment is: Modify the payroll program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the employee information, and a method within the class to calculate the weekly pay. Once stop is entered as the employee name, the application should terminate.

With the program that I have below, I'm getting <indentier> expected

weeklyPay.calculatePay( rate, hours );

Help is needed as soon as possible because it is due today.

import java.util.Scanner;

public class Payroll3

{

Employee weeklyPay = new Employee();

weeklyPay.calculatePay( rate, hours );

}

class Employee

{

double rate;

double hours;

double pay;

private String employeeName;

public Employee( String name )

{

employeeName = name;

}

public void setEmployeeName( String name )

{

employeeName = name;

}

public String getEmployeeName()

{

return employeeName;

}

public static double calculatePay( double rate, double hours )

{

Scanner input = new Scanner( System.in );

System.out.print( "Enter employee name or stop to quit: " );

employeeName = input.nextLine();

while ( !employeeName.equals("stop") )

{

System.out.printf( "Enter %s's hourly rate: ", employeeName );

rate = input.nextDouble();

System.out.printf( "Enter %s's number of hours worked: ", employeeName );

hours = input.nextDouble();

pay = rate*hours;

System.out.printf( "%s's payment for the week is $%.2f\n", employeeName, pay );

System.out.println();

System.out.print( "Enter employee name or stop to quit: " );

employeeName = input.next();

System.out.println();

}

}

}

[2011 byte] By [Quick2ua] at [2007-11-27 4:56:12]
# 1
weeklyPay.calculatePay( rate, hours );What are rate and hours?Before you answer, no they are not available in your Payroll3 class becuase you declared them in the Employee class.
floundera at 2007-7-12 10:11:19 > top of Java-index,Java Essentials,New To Java...
# 2
Also, I just realised you don't have that line of code in a method or constructor.
floundera at 2007-7-12 10:11:19 > top of Java-index,Java Essentials,New To Java...
# 3
I very new at this and do not know where to start and how and where do I put the method or constructor.
Quick2ua at 2007-7-12 10:11:19 > top of Java-index,Java Essentials,New To Java...
# 4
Do you have a main method in another class? If not you need to go back and revise the basics. Read your textbook. Look at online tutorials.
floundera at 2007-7-12 10:11:19 > top of Java-index,Java Essentials,New To Java...
# 5
Hii dude , you should use main method thanks ,sb
sb.majumder_07a at 2007-7-12 10:11:19 > top of Java-index,Java Essentials,New To Java...