I need help with an assignment - have got confused in the process of coding. I am a student and have this assignment to do. It is long, but let me explain what they want.
"Write a superclass Worker & subclasses HourlyWorker and SalariedWorker. Every worker has a name and a salary rate. Write a method computePay(int hours) that computes the weekly pay for every worker. An hourly worker gets paid the hourly wage for the actual number of hours worked, if hours are at most 40. If the hourly worker worked more than 40 hours, the excess is paid at time and a half. The salaried worker gets paid the hourly wage of 40 hours, no matter what the actual number of hours is. Write a static method that use polymorphism to compute the pay of any Worker. Supply a test program that test these classes and methods."
Would prefer if someone could email me on how to do this, and then I can show the code that I have done, and I seem to be totally LOST in this jungle of codes.
Your help will be greatly appreciated. Thank you