I am new to java programming(in my first year in school) I have a assignment to do and im kind of stumped as to how to proceed with it..
I have to build a simple program that will allow employees be the superclass, with 3 subclasses, production worker, team lead and supervisor. Production worker is on a hourly wage, team lead is on production workers wage + 15%, with a monthly bonus provided all the production workers meet their targets. The supervisor is on a yearly wage, however he is entitled to a bonus depending on how many production workers and team leaders he supervises.

My query is how to do the monthly bonus for the team lead and supervisor, Im not sure which class it should go into, can anybody point me in the right direction?

Thanks

November 26th, 2010, 05:11 PM

helloworld922

Re: Inheritance questions....

I think having something like an abstract "getYearlyPay" method would fit nicely inside your base employee. Then each of the three employees would implement this method with a different implementation. Calculating the bonuses would take place inside of this method.