本文整理汇总了C++中Bank类的典型用法代码示例。如果您正苦于以下问题:C++ Bank类的具体用法?C++ Bank怎么用?C++ Bank使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bank类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Bank bank;
int choice;
while(1)
{
system("cls");
PrintMenu();
cout << "선택 : ";
cin >> choice;
switch( choice)
{
case MAKE: bank.MakeAccount(); break;
case DEPOSIT: bank.Deposit(); break;
case WITHDRAW: bank.Withdraw(); break;
case INQUIRE: bank.Inquire(); break;
case EXIT: return 0;
default:
cout << "잘못된 메뉴 입력 " << endl;
break;
}
system("pause");
}
return 0;
}
示例2: main
int main(){
cout<<" Initiating bank "<<endl;
Bank BetaBank;
BetaBank.initBank();
cout<<"Select ATM ID [i]. To exit enter 0"<<endl;
int atmID;
while(atmID!=0){
cin>>atmID;
int t=atmID-1;
BetaBank.getBankTotalBalance_MSG();
cout<<"------------------------ATM"<<atmID<<"---------------------------\n";
BetaBank.bankATM[t].getBalance_MSG();
cout<<endl<<"1 - Resuply ATM with money Withdraw money - 2"<<endl<<"9 - Terminate session Check balance - 3"<<endl;
bool sessionTerminated = false;
while(sessionTerminated==false){
int input;
cin>>input;
if(input==1){
BetaBank.bankATM[t].initValue();
}
else if(input==2){
int request;
cout<<"Enter requested value"<<endl;
cin>>request;
BetaBank.bankATM[t].cashWithdrawal(request);
}
else if(input==3) BetaBank.bankATM[t].getBalance_MSG();
else if(input==9) sessionTerminated=true;
input=0;
}
示例3:
PublicBank::PublicBank(Bank &bank)
{
m_pDH=DH_new();
m_pDH->g=BN_dup(bank.g());
m_pDH->p=BN_dup(bank.p());
m_pDH->pub_key=BN_dup(bank.pub_key());
}
示例4: Bank
Set *load_false_positives()
{
int64_t NbInsertedKmers = 0;
char * rseq;
int readlen;
kmer_type kmer, graine, graine_revcomp;
Bank *FalsePositives = new Bank(return_file_name(false_positive_kmers_file));
// alloc false positives with the just the right estimated size
uint64_t nbFP = countFP(FalsePositives);
FPSet *fp = new FPSet(nbFP);
while (FalsePositives->get_next_seq(&rseq,&readlen))
{
kmer = extractKmerFromRead(rseq,0,&graine,&graine_revcomp);
fp->insert(kmer);
NbInsertedKmers++;
if ((NbInsertedKmers%table_print_frequency)==0) fprintf (stderr,(char*)"%cInsert false positive Kmers in hash table %lld",13,NbInsertedKmers);
}
fp->finalize(); // always call this when finishing to create a FPSet
fprintf (stderr,"\nInserted %lld false positive kmers in the hash structure.\n\n",NbInsertedKmers);
print_size_summary(fp);
return fp;
}
示例5: Bank
void GraphOutput::load_nodes_extremities(string linear_seqs_name)
{
kmer_links.clear(); // PIERRE: reset previous stored kmer links
Bank *Nodes = new Bank((char *)linear_seqs_name.c_str());
long nb_nodes = first_id_els.node; //PIERRE;
char * rseq;
int readlen;
sizeKmer--; // nodes extremities overlap by (k-1)-mers, so let's extract (k-1)-mers
while (Nodes->get_next_seq(&rseq,&readlen))
{
kmer_type left_kmer, right_kmer, left_kmer_fw, left_kmer_rc, right_kmer_fw, right_kmer_rc;
left_kmer = extractKmerFromRead(rseq,0,&left_kmer_fw,&left_kmer_rc, false);
right_kmer = extractKmerFromRead(rseq,readlen-sizeKmer,&right_kmer_fw,&right_kmer_rc, false);
Strand left_strand = (left_kmer == left_kmer_fw)?FW:RC;
Strand right_strand = (right_kmer == right_kmer_fw)?FW:RC;
kmer_links[left_kmer].insert(node_strand(nb_nodes, left_strand, LEFT));
kmer_links[right_kmer].insert(node_strand(nb_nodes, right_strand, RIGHT));
nb_nodes++;
}
Nodes->close();
delete Nodes;
sizeKmer++; // make sure to restore k
}
示例6: array
/*
This function fills up the array (up to max_accts) and
returns the actual number of accounts read in (referred to as num_accts).
*/
int read_accts(Bank& bank, int max_accts)
{
int i = 0;
//ifstream infile("C:\\Users\\Smart PC\\Desktop\\Assignment 3 (3110)\\myinput.txt");
ifstream infile("myinput");
string whiteSpace;
getline(infile, whiteSpace);
// check is file can be opened
if (infile)
{
// read only first max_accts accounts,
// in order to avoid overflow
for (i = 0; i<max_accts; i++)
{
string firstName;
string lastName;
string ssn;
string accountType;
int accountNumber;
int status;
double balance;
int transactions;
infile >> firstName;
// check is end of file reached
if (!infile.eof())
{
infile >> lastName;
infile >> ssn;
infile >> accountNumber;
infile >> accountType;
infile >> balance;
infile >> status;
infile >> transactions;
bank.addAccount(firstName, lastName, ssn, accountNumber, accountType, balance, status);
int index = bank.findAccount(accountNumber);
Account* acc = bank.getAccount(index);
for(int i=0; i<transactions; i++)
{
string transactionType;
double amount;
infile >> transactionType;
infile >> amount;
if (acc)
acc->addTransaction(Transaction(transactionType, amount));
}
}
else {
break;
}
}
示例7: programMessage
INT32 Editor::newBank( const string& path, const string& name, bool autosave )
{
bool save = autosave ? options_.autosave_ : false;
Bank* bank = synth_->getBank();
bank->newBank( path, name, save );
programMessage( BankChanged, NULL );
return bank->programNum_;
}
示例8: Client
Client(Bank& bank, long int money)
{
d_cl = vector<long int> (9);
money_cl = money;
d_cl = bank.get_d();
N_cl = bank.get_N();
//cout << "N_cl = " << N_cl << endl;
// for(int i = 0; i < d_cl.size(); i++)
// cout << d_cl[i] << ' ' << endl;
}
示例9: main
int main()
{
Bank* bank = new Bank();
Account* acc = new Account(1);
bank->Withdraw(acc, 100);
Account* saving = new SavingAccount(2);
bank->Withdraw(saving, 100);
//As LSP states, the program should be able to use the objects of derived class without breaking any behavior of base class. So in this code, I am passing a SavingAccount instance to Withdraw method, which executes the function defined in Account class. So we are adhering to LSP pattern here.
}
示例10: depositMoney
void BankTest::depositMoney()
{
Bank b;
int clientID = 10;
Money m(5, "USD");
b.deposit(clientID, m);
QCOMPARE(Money(5, "USD"), b.accountBalance(clientID));
QCOMPARE(1, b.numberOfClients());
}
示例11: childRemoved
void Mix::childRemoved(Component *c)
{
FlowController *f;
if ( (f = dynamic_cast<FlowController *>(c)) ) setCarrier(0);
ChildTypeCounter<Bank>::childRemoved(c);
Bank *b;
if ( (b = dynamic_cast<Bank *>(c)) ) {
mix_ratio.erase(b->name());
setMixtureRatios(mix_ratio);
}
}
示例12: childAdded
void Mix::childAdded(Component *c)
{
FlowController *f;
if ( (f = dynamic_cast<FlowController *>(c)) ) setCarrier(f);
ChildTypeCounter<Bank>::childAdded(c);
Bank *b;
if ( (b = dynamic_cast<Bank *>(c)) ) {
mix_ratio[b->name()] = 1.0;
setMixtureRatios(mix_ratio);
}
}
示例13: main
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
Bank JollyBank ;
JollyBank.ReadFile("/Users/selen/Desktop/css342/Assignment5/inputfile"); // file name e degismeli
JollyBank.ExecuteTransaction();
JollyBank.Display();
return 0;
}
示例14: find_bank
samplv1_programs::Bank *samplv1_programs::add_bank (
uint16_t bank_id, const QString& bank_name )
{
Bank *bank = find_bank(bank_id);
if (bank) {
bank->set_name(bank_name);
} else {
bank = new Bank(bank_id, bank_name);
m_banks.insert(bank_id, bank);
}
return bank;
}
示例15: Add_Account
/**
This is where we add a new account in the bank
If it is a new customer, we also need to get additional information
to add a new customer record in the bank.
@param bank Bank object to which we will be adding accounts
*/
void Add_Account(Bank &bank)
{
string name;
cout << "Please enter your name: ";
cin.ignore();
getline(cin, name);
int acct_type;
string menu_string = "Type of account: \n";
menu_string += " 0 - Savings\n";
menu_string += " 1 - Checking\n";
menu_string += "Enter: ";
acct_type = read_int(menu_string, 0, 1);
string acct_type_str;
if (acct_type == 0)
acct_type_str = "savings";
else
acct_type_str = "checking";
Account *acct = bank.add_account(name, acct_type_str); // attempt to add an account
if (acct == NULL) { // case for new user
cout << "You appear to be a new user. We will need more information.\n";
// get all the required information for a new user
cout << "Address: ";
string address;
cin.ignore();
getline(cin, address);
string telephone;
cout << "Telephone Number: ";
getline(cin, telephone);
cout << "Age: ";
int age;
cin >> age;
int cust_type;
string menu_string = "Type of customer: \n";
menu_string += " 0 - Adult\n";
menu_string += " 1 - Senior\n";
menu_string += " 2 - Student\n";
menu_string += "Enter: ";
cust_type = read_int(menu_string, 0, 2);
string cust_type_str;
if (cust_type == 0)
cust_type_str = "adult";
else if (cust_type == 1)
cust_type_str = "senior";
else
cust_type_str = "student";
acct = bank.add_account(name, address, telephone, age, cust_type_str, acct_type_str);
}