title: Getting a value form "get and set" in java
body: <p>I have a school problem that I'm stuck on. The problem is that the gross pay keeps coming up as 0.0.</p>
  
  <p><strong><em>Here's the question:</em></strong></p>
  
  <p>Design a Payroll class  with the following fields:</p>
  
  <p>• name : a String  containing the employee's name 
  • idNumber: an int  representing the employee's ID number
  • rate: a double  containing the employee's hourly pay rate
  • hours: an int  representing the number of hours this employee has worked</p>
  
  <p>The class  should also have the following methods :</p>
  
  <p>• Constructor : takes the employee's name  and ID number as arguments 
  • Accessors: allow access to all of the fields of the Payroll class 
  • Mutators: let the user assign  values  to the fields of the Payroll class 
  • grossPay: returns the employee's gross pay, which is calculated as the number of 
  hours worked times the hourly pay rate.</p>
  
  <p>Write another program  that demonstrates the class  by creating a Payroll object , then
  asking the user to enter the data for an employee in the order: name , ID number, rate, hours.
  The program  should then print out a statement  in the following format (for example, if
  you had an employee named  Chris Jacobsen with ID number 11111, who works for 5 hours at 
  $10/hr):</p>
  
  <p>Chris Jacobsen, employee number 11111, made $50.00 in gross pay.</p>
  
  <p>Using text forming so that the gross pay is rounded to two decimal places.</p>
  
  <p><strong><em>Here's what I have so far:</em></strong></p>
  
  <pre><code>         import java.util.Scanner;
  
       public class Payroll
       {
          private String EmployeeName;
          private int IDnumber;
          private double HourlyPayRate;
          private double TotalHoursWorked;
          private double TotalGrossPay;
  
          public Payroll(String Name, int ID, double HourlyRate, double HoursWorked)
          {
              EmployeeName = Name;
              IDnumber = ID;
          }
          public String getEmployeeName()
          {
              return EmployeeName;
          }
          public int getIDnumber()
          {
              return IDnumber;
          }
          public void setHourlyPayRate(double HourlyRate)
          {
              HourlyPayRate = HourlyRate;
          }
          public double getHourlyPayRate()
          {
              return HourlyPayRate;
          }
          public void setTotalHoursWorked(double HoursWorked)
          {
              TotalHoursWorked = HoursWorked;
          }
          public double getTotalHoursWorked()
          {
              return TotalHoursWorked;
          }
          public void setTotalGrossPay(double GrossPay)
          {
              TotalGrossPay = GrossPay;
          }
          public double getTotalGrossPay(double HourlyRate, double HoursWorked)
          {
              TotalGrossPay = HourlyRate * HoursWorked;
             return TotalGrossPay;
          }
  
  
          public static void main(String[] args)
          {
              String EmployeeName;
              int IDnumber;
              double TotalHoursWorked;
              double HourlyPayRate;
              double TotalGrossPay;
  
             Scanner keyboard = new Scanner(System.in);
  
              System.out.print("Enter employee's name:");
              EmployeeName = keyboard.nextLine();
  
              System.out.print("Enter employee's ID number:" );
              IDnumber = keyboard.nextInt();
  
              System.out.print("Enter hourly rate:");
              HourlyPayRate = keyboard.nextDouble();
  
              System.out.print("Enter number of hours worked:");
              TotalHoursWorked = keyboard.nextDouble();
  
              Payroll pay = new Payroll(EmployeeName, IDnumber, HourlyPayRate, TotalHoursWorked);
  
              System.out.print(EmployeeName + ", " + "employee number " + IDnumber + ", made $" + 
             pay.TotalGrossPay + " in gross pay.");
         }
    }
  </code></pre>
  
  <p>Thanks for any help...</p>