Question: b. In Chapter 5, you created a War Card game that randomly selects two cards (one for the player and one for the computer) and

 b. In Chapter 5, you created a War Card game that

b. In Chapter 5, you created a War Card game that randomly selects two cards (one for the player and one for the computer) and declares a winner (or a tie). Modify the game to set each Card's suit as the appropriate string, then execute the game using the newly modified Card class. Figure 7-18 shows four typical executions. Recall that in this version of War, you assume that the Ace is the lowest-valued card. Save the game as War2.java. Command Prompt - OX C:\Java>java War2 My card is the 10 of Diamonds Your card is the Queen of Hearts You win C:\Java>java War2 My card is the Ace of Diamonds Your card is the 7 of clubs You win C:\Java>java War2 My card is the 10 of Hearts Your card is the 10 of Spades It's a tie C:\Java>java War2 My card is the 9 of Diamonds Your card is the 3 of Diamonds I win C:\Java> Figure 7-18 Four typical executions of the War2 game

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!