Overriding
Hi,
I am novice in DOTNET and OOPS Programming. I have a small doubt. I have code which calculates bonus and salary. The code is given below.
class Payment_details
dim payment as integer
overridable function Emp_payment(Byval HoursWorked as decimal, ByVal PayRate as decimal) as Double
Payment = HoursWorked * Payrate
Return Payment
End Function
Class Bonus_Details
Inherits Payment_details
overridable function Emp_payment(Byval HoursWorked as decimal, ByVal PayRate as decimal) as Double
Payment = MyBase.Emp_payment (HoursWorked,Payrate) *0.1
Return Emp_payment
End Function
Now I want that the Bonus Details class should return both Bonus and Total i.e Bonus +Payment or can we create a third inherited class which returns the total of bonus and payment.
It may look funny question to u but i m novice. please help.
Thanking you and waiting for some kind replies.
Amit
|