I have a method in my baseclass that returns a bool and I want that bool to determine what happens to the same overridden method in my derived class.
Base:
public bool Debt(double bal)
{
double deb = 0;
bool worked;
if (deb > bal)
{
Console.WriteLine("Debit amount exceeds the account balance – withdraw cancelled");
worked = false;
}
else
bal = bal - deb;
worked = true;
return worked;
}
Derived
public override void Debt(double bal)
{
// if worked is true do something
}
Note that bal comes from a constructor I made earlier