Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
- Write Java functions performs the following steps:
- getHourlyRate()
- Prompt the user for an hourly pay rate
- If the hourly pay rate is less than zero or greater than 50 then return a value of negative 1
- If the hourly pay rate is greater than zero and less than or equal to 50 return the pay rate
- getWorkedHours()
- Pass this function the hourly pay rate which was retrieved from the getHourlyRate()
- Prompt the user for the hours worked
- If the hours worked is less than zero or greater than 100 then return -1
- If the hours worked are 40 or less than multiply the hourly rate by the hours worked and return the value
- 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
- Return the total pay
- getHourlyRate()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started