コード例 #1
0
ファイル: Account.cs プロジェクト: itsmht/OOP2_Sp21_Final
 virtual public void Transfer(int amount, Account acc)
 {
     if (accBalance > amount)
     {
         accBalance = accBalance - amount;
         accBalance = accBalance + amount;
         Console.WriteLine("Balance Transfered.");
         Transaction t = new Transaction(this, acc, amount, "Money Transfer");
         this.addtransaction(t);
         acc.addtransaction(t);
     }
     else
     {
         Console.WriteLine("Invalid Amount.");
     }
 }