PayIn() public method

public PayIn ( decimal amount ) : void
amount decimal
return void
コード例 #1
0
ファイル: CurrentAccounts.cs プロジェクト: ianheyi/CSharp
 static void Main()
 {
     IBankAccount venusAccount = new SaverAccount();
     ITransferBankAccount jupiterAccount = new CurrentAccount();
     venusAccount.PayIn(200);
     jupiterAccount.PayIn(500);
     jupiterAccount.TransferTo(venusAccount, 100);
     Console.WriteLine(venusAccount.ToString());
     Console.WriteLine(jupiterAccount.ToString());
 }
コード例 #2
0
ファイル: Kahil_Lab1b.cs プロジェクト: ryekayo/RyansRepo
 static void Main()
 {
     IBankAccount venusAccount = new SaverAccount(); //When F9 is pressed, IBankAccount is called from interface Wrox.ProCSharp.IBankAccount
     ITransferBankAccount jupiterAccount = new CurrentAccount(); //Each Method is called from an Interface
     venusAccount.PayIn(200); //venusAccount is a local variable, When F5(debug) is pressed, value of venusAccount is set to null
     jupiterAccount.PayIn(500);
     jupiterAccount.TransferTo(venusAccount, 100);
     Console.WriteLine(venusAccount.ToString());//When F5 is pressed on this line, value changes from null to 0
     Console.WriteLine(jupiterAccount.ToString());//When F5 is pressed on this line, value changes from null to 0
 }