Question: Write a Java program that implements the following features: Write Java functions performs the following steps: getHourlyRate() Prompt the user for an hourly pay rate

Write a Java program that implements the following features:

  1. Write Java functions performs the following steps:
    1. getHourlyRate()
      1. Prompt the user for an hourly pay rate
      2. If the hourly pay rate is less than zero or greater than 50 then return a value of negative 1
      3. If the hourly pay rate is greater than zero and less than or equal to 50 return the pay rate
    2. getWorkedHours()
      1. Pass this function the hourly pay rate which was retrieved from the getHourlyRate()
      2. Prompt the user for the hours worked
      3. If the hours worked is less than zero or greater than 100 then return -1
      4. If the hours worked are 40 or less than multiply the hourly rate by the hours worked and return the value
      5. If the hours worked are greater than 40 then compute the base pay by multiplying 40 by the hourly rate and multiplying the hours over 40 by 1.5 times the hourly rate
      6. Return the total pay

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!