a. You designed a Card class. The class holds fields that contain a Cards value and suit.
Question:
Also, add a new field to the class to hold the string representation of a Cards rank based on its value. Within the Card class setValue() method, besides setting the numeric value, also set the string rank value as follows.
b. 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 Cards suit as the appropriate string, then execute the game using the newly modified Card class. Figure 7-18 shows a typical execution. Recall that in this version of War, you assume that the Ace is the lowest-valued card. Save the game as War2.java.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: