// Marble Jar class: for probability simulations // // Dave Reed davereed@creighton.edu // // CONSTRUCTION: with two ints (# of black & white marbles, resp.) // // *************************PUBLIC OPERATIONS********************* // String DrawMarble() --> Return color of random marble // (either "BLACK" or "WHITE") // Note: marble is removed from jar // void AddMarble(String marble) --> Add marble (specify color) // Bool IsEmpty() --> Return true if no marbles in jar ////////////////////////////////////////////////////////////////// #ifndef _MARBLEJAR_H_ #define _MARBLEJAR_H_ enum Color { BLACK, WHITE }; class MarbleJar { public: MarbleJar(int black, int white); Color DrawMarble(); void AddMarble(Color marble); bool IsEmpty(); private: int numBlack, numWhite; }; #endif