Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

i need to make a player class for Rock Paper Scissors on C++ the object oriented way...with private attributes for weapon choice and score...any ideas?

OpenStudy (anonymous):

what is the weapon choices?

OpenStudy (anonymous):

rock paper and scissors

OpenStudy (anonymous):

Well think about it, how do you represent weapon choice and score? Weapon choice would probably be best as an enum, like so. enum WeaponChoice { ROCK, PAPER, SCISSORS }; I assume score is how many games they've won or lost, so that can just be an int. Then you just declare em as private members of your class. class Player { private: WeaponChoice weapon_choice; int score; };

OpenStudy (anonymous):

thank you!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!