I am having trouble figuring out how to start this assignment. I am really struggling with my Java class can you please help? The Assignment is as follows:
Method named initialize that initializes the values of the rate and hours variables to 0 and the
name variable to Any Worker. Void or value-returning method?
2. Method named getHoursRate that prompts the user to input values for the hours worked and
rate of pay per hour and based on those input values changes the values these two variables
were set to by the initialize method above. Void or value-returning method?
3. Method named calculateWages that calculates and returns the amount due the employee based
on the hours worked and rate of pay per hour. The hours worked and rate per hour are stored in
the variables rate and hours respectively. The formula for calculating the amount due the
employee is as follows: for the first 40 hours, the rate is the given rate; for hours over 40, the
rate is 1.5 times the given rate.
4. Method named printCheck that prints (outputs) the named Employee, the hours worked, rate of
pay per hour and the amount due the employee.
5. Modify the main method in the provided WeeklyWages program to use and test each of the
We were given this to start with:
public class WeeklyWages
static Scanner console = new Scanner(System.in);
static double wages, rate, hours;
public static void main(String args)
System.out.print("Line 2: Enter the working "
+ "hours: "); //Line 2
hours = console.nextDouble(); //Line 3
System.out.println(); //Line 4
System.out.print("Line 5: Enter the pay "
+ "rate: "); //Line 5
rate = console.nextDouble(); //Line 6
System.out.println(); //Line 7
if (hours > 40.0) //Line 8
wages = 40.0 * rate +
1.5 * rate * (hours - 40.0); //Line 9
else //Line 10
wages = hours * rate; //Line 11
System.out.printf("Line 12: The wages are $%.2f %n",
wages); //Line 12
System.out.println(); //Line 13