Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can we put reportCompareAll()method in RockPaperScissorDemo class instead of Roc

ID: 3658687 • Letter: C

Question

Can we put reportCompareAll()method in RockPaperScissorDemo class instead of RockPaperScissors class?
What types of change is needed for it to work? Provide your reason for why yes or why not.

Yes. But you have to make userpick and computerpick fields public instead of private under RockPaperScissors class, which will break data encapsuation rule. compareResult method should be become public access modifier also. So, its not reccomend doing so. Which also means RockPaperScissors class need to provide such method for outside to use.

this was my answer^^^ but the teacher said another answer.
plz help -___-

Explanation / Answer

first of all if you have given the code for which you are talking then i could have answered in a much better way...... well your teacher said another answer because you had not given any reason to justify your answer, instead you are just mentioning the consequences of your answer.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote