Ask your own question, for FREE!
Computer Science 18 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!
Latest Questions
Jalissa21: What does adenoma mea?
22 minutes ago 2 Replies 0 Medals
Twilightt: How Can We Prevent Gun Violence in American Schools?
22 minutes ago 4 Replies 1 Medal
Twaylor: possible?
2 days ago 5 Replies 0 Medals
Arriyanalol: hekp
4 days ago 33 Replies 0 Medals
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!