February 5th, 2013, 11:02 AM
-
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
February 5th, 2013, 02:30 PM
-
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