コード例 #1
0
void VideoStore::rentVideo(Customer &customer, int movieID)
{
	db->rentVideo(customer.getID(), movieID);
	db->updateQuantity(customer.getID(), 1);
	db->updateVideoQuantity(movieID, -1);
	customer.rentVideo(movieID);
}
コード例 #2
0
ファイル: user.cpp プロジェクト: amaclean199/ATM-App
void Manager::dispAccount(int uID){
    Customer foundCust = findCust(uID);
    cout<<"\nUsername: "******"\nID Number: " << foundCust.getID();
    if (foundCust.hasChequing()){
        cout<<"\nChequing Account Balance: $"<<foundCust.getBalance(0);
    }
    if (foundCust.hasSavings()){
        cout<<"\nSavings Account Balance: $"<<foundCust.getBalance(1);
    }
    cout<<endl;
}
コード例 #3
0
ファイル: ui.cpp プロジェクト: Volvagia356/oop-ds-assignment
void memberRegistration() {
    clearScreen();
    cout << "Member Registration" << endl
         << "Register what kind of member?" << endl
         << "1. Gold Member" << endl
         << "2. Platinum Member" << endl
         << "3. Cancel" << endl << endl;
    int memberType;
    Customer* c;
    bool success;
    do {
        success=true;
        cout << "Selection: ";
        memberType=getInt();
        if(memberType==1 || memberType==2) {
            char name[256];
            do {
                cout << "Enter name: ";
                cin.getline(name,32);
                if(!cin) {
                    cin.clear();
                    cin.ignore(numeric_limits<streamsize>::max(),'\n');
                }
                if(name[0]==0) {cout << "Invalid name!" << endl;}
            } while(name[0]==0);
            switch(memberType) {
                case 1:
                    c=new MemberGold(name);
                    break;
                case 2:
                    c=new MemberPlatinum(name);
                    break;
            }
        } else if(memberType==3) {
            return;
        } else {
            success=false;
        }
    } while(!success);
    Transaction* t=new Transaction(c);
    t->registerMember();
    cout << "The member ID is " << c->getID() << endl;
    checkout(t);
    delete t;
    t=NULL;
}
コード例 #4
0
History::History(Customer cust, Business bus)
{
	customerHistoryID = cust.getID();
}