Answer to Question #325659 in C# for MPal

Question #325659

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:

  • The constructor should initialize the ‘accountNo’ and ‘balance’ member variables with appropriate values

Account (long, double, string [], long []) method:

  • The constructor should initialize ‘payees’ and ‘payeesAccount’ member variables. ‘accountNo’ and ‘balance’ member variables should be initialized by calling the appropriate constructor

DebitAmount(amount) method:

 



1
Expert's answer
2022-04-08T06:08:12-0400
 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();
        }

    }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS