BigBank.cpp
上传用户:sz0451
上传日期:2022-07-29
资源大小:256k
文件大小:1k
- // This is the main project file for VC++ application project
- // generated using an Application Wizard.
- #include "stdafx.h"
- #include "CurrentAccount.h"
- #include "SavingsAccount.h"
- #using <mscorlib.dll>
- using namespace System;
- // This is the entry point for this application
- #ifdef _UNICODE
- int wmain(void)
- #else
- int main(void)
- #endif
- {
- Console::WriteLine(S"Testing the CurrentAccount");
- CurrentAccount * current = new CurrentAccount(S"Emily", 100);
- current->Credit(500);
- current->Debit(600); // Should be accepted
- current->Debit(1); // Should be declined
- Console::WriteLine(current->ToString());
- Console::WriteLine(S"nTesting the SavingsAccount");
- SavingsAccount * savings = new SavingsAccount(S"Thomas");
- savings->Credit(500);
- savings->Debit(50); // Should be accepted
- savings->Debit(46); // Should be declined
- Console::WriteLine(savings->ToString());
- return 0;
- }