Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
If the function is required by the base class then it needs to be defined in the base class. You could add an abstract function to the base class though and only implement it in the sub class.[code=csharp]using System;namespace Reeks6{ abstract class BankAccount { //constructor public abstract bool CanDebit(double amount); public void Debit(double amount) { if (CanDebit(amount)) { balance -= amount; Console.Write("Debit succeeded "); } } }}[/code]edit : typo
If the function is required by the base class then it needs to be defined in the base class. You could add an abstract function to the base class though and only implement it in the sub class.
[code=csharp]
using System;
namespace Reeks6
{
abstract class BankAccount
//constructor
public abstract bool CanDebit(double amount);
public void Debit(double amount)
if (CanDebit(amount))
balance -= amount;
Console.Write("Debit succeeded ");
}
[/code]
edit : typo