BigBank.cpp
上传用户:sz0451
上传日期:2022-07-29
资源大小:256k
文件大小:1k
源码类别:

.net编程

开发平台:

Visual C++

  1. // This is the main project file for VC++ application project 
  2. // generated using an Application Wizard.
  3. #include "stdafx.h"
  4. #include "CurrentAccount.h"
  5. #include "SavingsAccount.h"
  6. #using <mscorlib.dll>
  7. using namespace System;
  8. // This is the entry point for this application
  9. #ifdef _UNICODE
  10. int wmain(void)
  11. #else
  12. int main(void)
  13. #endif
  14. {
  15.     Console::WriteLine(S"Testing the CurrentAccount");
  16.     CurrentAccount * current = new CurrentAccount(S"Emily", 100);
  17.     current->Credit(500);
  18.     current->Debit(600);         // Should be accepted
  19.     current->Debit(1);           // Should be declined
  20.     Console::WriteLine(current->ToString());
  21.     Console::WriteLine(S"nTesting the SavingsAccount");
  22.     SavingsAccount * savings = new SavingsAccount(S"Thomas");
  23.     savings->Credit(500);
  24.     savings->Debit(50);          // Should be accepted
  25.     savings->Debit(46);          // Should be declined
  26.     Console::WriteLine(savings->ToString());
  27.     return 0;
  28. }