Banker.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 "Bank.h"
- #include "Account.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"Bank example");
- // Create a bank
- Bank* theBank = new Bank();
- // Create some accounts
- Account* accountOne = new Account(123456, 100.0, 0.0);
- Account* accountTwo = new Account(234567, 1000.0, 100.0);
- Account* accountThree = new Account(345678, 10000.0, 1000.0);
- // Add them to the Bank
- theBank->Add(accountOne);
- theBank->Add(accountTwo);
- theBank->Add(accountThree);
- // Use the indexed property to access an account
- Account* pa = theBank->Acct[234567];
- Console::WriteLine("Balance is {0}", __box(pa->get_Balance()));
- return 0;
- }