Could someone please offer some useful tips as I'm new to C# and stuck with this.
I have created a base class Person and the derived classes Admin, FT, PT, LocStudent and IntStudent.
Now, I need to create an array of type Person and instantiate all derived classes above as 5 separate elements of an array.
I also need to hard code calls to each constructor.
Person [] = new Person [5];
Person[0] = new FT_Teacher("Jerry", "MacGuire",1);
The derived class FT_Teacher contained the following:
public class FT_Teacher : Teacher
{
int teachLoad = 0;
double salary = 0;
public FT_Teacher(String familyName, String givenName, int employeeID)
:base(familyName, givenName, employeeID)
{
}
public override double ComputeAmount(double amount)
{
return (salary/52)*(teachLoad / 40);
}
// Override ComputeLeave method to apply to FT Teacher.
public override int ComputeLeave(int leave)
{
return (teachLoad / 40) * 28;
}
// public override void PrintDetails;
public override void PrintDetails()
{
throw new NotImplementedException(); //Just a dummy response at this stage.
}
}
It's spitting back the error "Must contain a return type" at me.
What am I doing wrong? help, Im pulling my hair out -- and I am naturally bald!!
This post has been edited by eclipsed4utoo: 14 March 2010 - 07:01 AM
Reason for edit:: please use the code tags....[code] your code here [/code]

New Topic/Question
Reply




MultiQuote








|