Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Inheritance questions....

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Inheritance questions....

    Hi all,

    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


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default 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.

  3. The Following User Says Thank You to helloworld922 For This Useful Post:

    smellyhole85 (November 27th, 2010)

Similar Threads

  1. inheritance help
    By justin3492 in forum Object Oriented Programming
    Replies: 3
    Last Post: September 30th, 2010, 07:45 PM
  2. inheritance
    By b109 in forum Java Theory & Questions
    Replies: 3
    Last Post: May 30th, 2010, 09:23 PM
  3. A few questions
    By adenverd in forum Java Theory & Questions
    Replies: 3
    Last Post: May 26th, 2010, 03:34 AM
  4. Static fields and inheritance
    By helloworld922 in forum Java Programming Tutorials
    Replies: 1
    Last Post: January 22nd, 2010, 03:02 AM
  5. Problem with OOP - Inheritance
    By connex in forum Object Oriented Programming
    Replies: 1
    Last Post: December 14th, 2009, 10:11 PM