0

C# virtual method that takes decimal vales from inherited class then calculates a total.

I have created a program with serveral classes, employee is the main which the other classes inherent from, the other classes get value decimal for hours work and hourly pay. the method created in employee multiplies hours worked by hourly pay but I don't know how to write this method

18th Jul 2017, 9:54 PM
Jimi Walsh
Jimi Walsh - avatar
1 Antwort
0
if all the inherited class have hours works and hourly pay why not have these in the base class? if not can use override declaration on the method in inherited class to override the employee inplementation so specific for each type of inhereted class.
7th Aug 2017, 11:33 AM
Matthew Watson
Matthew Watson - avatar