// FILE: card_demo.cpp // This is a small demonstration program showing how the bag class is used. #include // Provides cout and cin #include // Provides EXIT_SUCCESS #include #include #include "card.h" #include "deck.h" #include "player.h" using namespace std; int main( ) { Deck d; d.shuffle(); Card c = d.dealCard(); cout << "deal test " << c << endl; cout << endl; Player p("Joe"); cout << p.getName() << endl; p.addCard(c); p.addCard(d.dealCard()); cout << p.showHand() << endl; int numCards = 5; vector cards(numCards); srand((unsigned)time(0)); //seed the random number generator for (int i = 0; i < numCards; i++) { int rank = (rand() % 13) + 1; int suit = (rand() % 4) + 1; Card c(rank,(Card::Suit)suit); cout << "rank - " << rank << " " << c << endl; cards[i] = c; } for (int i = 0; i < cards.size(); i++) cout << cards[i] << endl; cards.erase(cards.begin()+2); cout <<"after"<