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

Modify the War Game program to play until the player hands are empty. That is, a

ID: 3790986 • Letter: M

Question

Modify the War Game program to play until the player hands are empty. That is, after the deck is empty, the players must continue playing until they have played the three remaining cards in their hands.

Your modifications must be minimal. 30% of your grade is based on how minimal and correct is your solution.

The program is in C++

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Random.cpp

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Deck.cpp

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Card.cpp

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I originally thought that I could edit the player class by adding in a function that stores the number of cards the player has, and in the main function once the deck is empty it checks to see if the player hands is empty and if it isn't then it starts subtracting the number of cards in the players hand. I altered the while to determine if the deck is empty and one of the players hands are empty then it displays the score. Unfortunately everytime I would try to do something like this it just fails and is limited by the deck. Maybe you guys might be able to help me out because I am desprate to figure this out, because it's due Monday and I've been trying for three days now. It might be a simple fix that I'm not seeing so please someone help me understand how to do this. Thank you in advance for the help.

Explanation / Answer

hope this helps,you to atleaste get an idea how to proceed.

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