ProblemStatement:
This exercise needs to be submitted through the Visual Studio Package: Day2->Assignment2
A corporate bank ’IEBI’ needs to automate the process of transferring the money.
Class Diagram:
Account (long, double) method:
Account (long, double, string [], long []) method:
DebitAmount(amount) method:
internal class Program
{
class Account
{
public long AccountNo { get; set; }
public double Balance { get; set; }
public string[] Payees { get; set; }
public long[] PayeesAccount { get; set; }
public Account(long accountNo, double balance)
{
AccountNo = accountNo;
Balance = balance;
}
public Account(long accountNo, double balance, string[] payees, long[] payeesAccount)
{
AccountNo = accountNo;
Balance = balance;
Payees = payees;
PayeesAccount = payeesAccount;
}
public string DebitAmount(double amount)
{
Balance += amount;
return $"AccountNO: {AccountNo}, Balance topped up";
}
public override string ToString()
{
return $"AccountNO: {AccountNo}, Balance: {Balance}";
}
}
static void Main(string[] args)
{
Account account = new Account(1, 5000);
Console.WriteLine(account.DebitAmount(500));
Console.WriteLine(account);
Console.ReadKey();
}
}
Comments
Leave a comment