Question
Write a public method that takes two arguments: a double representing the number of hours worked and a double representing the hourly pay, and returns
Write a public method that takes two arguments: a double representing the number of hours worked and a double representing the hourly pay, and returns a double representing the weekly pay. If the hours are less than or equal to 40, the weekly pay should be hours times hourly pay. If the hours are greater than 40 and less than 80, the weekly pay should be 40 times the hourly pay, plus the hours in excess of 40 times hourly pay times 1.5. If the hours worked are entered as less than zero or greater than 80, print an error message saying "incorrect number of hours entered" and return 0.0;
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