a. Create a game called Last Man Standing in which the objective is to select the last
Question:
a. Create a game called Last Man Standing in which the objective is to select the last remaining JCheckBox. The game contains 10 JCheckBoxes. The player can choose one, two, or three boxes, and then click a JButton to indicate the turn is complete. The computer then randomly selects one, two, or three JCheckBox objects.
When the last JCheckBox is selected, display a message indicating the winner.
Save the game as LastManStanding.java.
b. In the current version of the Last Man Standing game, the computer might seem to make strategic mistakes because of its random selections. For example, when only two JCheckBox objects are left, the computer might randomly choose to check only one, allowing the player to check the last one and win. Modify the game to make it as smart as possible, using a random value for the number of the computer’s selections only when there is no superior alternative.
Save the improved game as SmarterLastManStanding.java.
Step by Step Answer: