The BankAccount Entity represents a bank account. The code implements specific operations through methods and properties. It must supports below behaviour:
- It has a 10-digit number that uniquely identifies the bank account.
- It has a string that stores the name of owner.
- The balance can be retrieved.
- It accepts deposits.
- The initial balance must be Zero (positive).
- It does not allow negative amount to deposit.
Class Name: Transaction
Method:
public Transaction(decimal amount, DateTime date, string note)
{}
Property:
public decimal Amount { get; }
public DateTime Date { get; }
public string Notes { get; }
=================
Class Name: BankAccount
Method:
public void MakeDeposit(decimal amount, DateTime date, string note)
{
// 1) if the amount of the deposit isn't greater than 1, should throw ArgumentOutOfRangeException() exception
//2) else, create transaction object and add into collection (allTransactions)
// 3) maximum transaction limit per account holder is 3, if account holder try more than that, then throw custom exception (TransactionLimitReachedException)
}
Property:
public string Number { get; }
public string Owner { get; set; }
public decimal Balance { get; }
private List allTransactions = new List();