当前位置: 首页>>代码示例>>C++>>正文


C++ Bank类代码示例

本文整理汇总了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;
}
开发者ID:gawallsibya,项目名称:BIT_C-CPP,代码行数:27,代码来源:main.cpp

示例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;
      }
开发者ID:Animakozak,项目名称:Homework,代码行数:30,代码来源:main.cpp

示例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());
    }
开发者ID:1974kpkpkp,项目名称:Open-Transactions,代码行数:7,代码来源:bankimp.cpp

示例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;
}
开发者ID:nickingle,项目名称:clipper,代码行数:34,代码来源:Debloom.cpp

示例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
}
开发者ID:nickingle,项目名称:clipper,代码行数:29,代码来源:GraphOutput.cpp

示例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;
            }
        }
开发者ID:FBHKHAN,项目名称:Banking-System,代码行数:63,代码来源:main.cpp

示例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_;
}
开发者ID:dreieier,项目名称:Nexus,代码行数:9,代码来源:Editor.cpp

示例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;   
 }
开发者ID:AntonBobrovsky,项目名称:cryptography,代码行数:10,代码来源:bank.cpp

示例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.
}
开发者ID:mjaimin,项目名称:DesignPatterns,代码行数:10,代码来源:LSPComplience.cpp

示例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());
}
开发者ID:KDE,项目名称:kdev-xtest,代码行数:10,代码来源:banktest.cpp

示例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);
  }
}
开发者ID:ruby6117,项目名称:ccode,代码行数:11,代码来源:Olfactometer.cpp

示例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);
  }
}
开发者ID:ruby6117,项目名称:ccode,代码行数:11,代码来源:Olfactometer.cpp

示例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;
}
开发者ID:taskins,项目名称:Banking-System,代码行数:12,代码来源:main.cpp

示例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;
}
开发者ID:rncbc,项目名称:samplv1,代码行数:12,代码来源:samplv1_programs.cpp

示例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);
	}
开发者ID:eparslow18,项目名称:CS273_Data_Structures,代码行数:59,代码来源:Banking_Application.cpp


注:本文中的Bank类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。