Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2006, 09:58 PM
Registered User
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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









Similar Threads
Thread Thread Starter Forum Replies Last Post
new keyword vs method overriding anand_instra C# 1 April 30th, 2008 01:46 PM
Overriding the TreeView Control Aaron Edwards ASP.NET 2.0 Basics 0 January 27th, 2006 05:48 PM
Overloading Overriding arv1980 VS.NET 2002/2003 2 January 22nd, 2006 12:55 AM
Most efficient overriding technique jcsdeveloper C# 4 December 7th, 2005 04:18 PM
Overriding the ispostback method Indo77 ASP.NET 1.0 and 1.1 Basics 3 April 6th, 2005 02:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.