Subject: Overriding
Posted By: arv1980 Post Date: 1/21/2006 8:58:59 PM
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





Go to topic 38906

Return to index page 389
Return to index page 388
Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380