Thread: Print salary

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Smile Print salary


    I need help because i don't know too much about java,its my first class of, but if you tell me which is best way to do it i will be greatfull
    My teacher is trying to make us do a java project, using:

    Create the program based on the following diagram. The program should calculate the salaries of all employees and print it on the screen. The salaries of the workers are calculated as follows:

    salaryPerHour * workTime

    The salaries of the managers are calculated as follows:

    productsSold * rewardPerProduct + bonuses

    Set the values of these attributes for each employee instance according to your judgment.

    4 classes to do:
    Employee
    name:String
    +calculatesalary():int

    EmployeeList
    employees:Vector
    +allemployeesSalary():int
    +getCount():int

    Manager
    bonuses
    productSold
    rewardPerProduct
    +calculateSalary():int

    Worker
    salaryPerhour
    workTime
    +calculatesalary():int

    with this 4 classes i could not print the count, please Help a young lady begginer in this code world
    thank you
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    74
    Rep Power
    19
    Hi,

    can you provide us with the code you already fabricated? Looking at the description your teacher expects you to use inheritance. In that case you should look again at the base class : Employee

IMN logo majestic logo threadwatch logo seochat tools logo