How do i go about doing calculation function?w

Say, i have a calculationPay() and i have a base class Staff and 2 derived class TempStaff and ContractStaff classes.

For the relevant fields, i have float monthlyPay, float overtimeHours, float overtimeRate. How do i implement a calculationPay() such that they are able to display the results in each of the Staff objects.

The formula is as follow:
Yearly gross pay = (monthlyPay * 12) + (overtimeHours * overtimeRate)

Pls advise...
Topic archived. No new replies allowed.