예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (bank >= 10)
     {
         bank -= joe.ReceiveCash(10);
         UpdateForm();
     }
     else
     {
         MessageBox.Show("The Bank is out of money.");
     }
 }
예제 #2
0
 private void joeGivesToBob_Click(object sender, EventArgs e)
 {
     bob.ReceiveCash(joe.GiveCash(10)); // joe.Cash -= bob.ReceiveCash(10); created error, cash returns below zero
     UpdateForm();
 }
예제 #3
0
파일: Form1.cs 프로젝트: nohe427/HeadFirst
 private void joeGivesToBob_Click(object sender, EventArgs e)
 {
     bob.ReceiveCash(joe.GiveCash(10));
     UpdateForm();
 }