Design Specification Requirements Note: Refer to the sample output in the Exampl
ID: 3681566 • Letter: D
Question
Design Specification Requirements
Note: Refer to the sample output in the Example Output section below.
1. Implement the classes defined in the provided UML Class diagram
A. TheBigBangGame class methods
1. main
a. Display the programmer’s name and project title on separate lines and a blank line
b. Create an object instance of the TheBigBangGame class
c. Call the TheBigBangGame object’s execute method
1. Pass the command-line arguments
2. displayResults
a. Displays Sheldon’s and Leonard’s wins and ties (see Example Output)
3. execute
a. Convert the provided shapes using the Game object’s convertShape method
1. The shapes are included in the command-line arguments
b. Create an object instance of the Game class
c. Call the Game object’s playGame method
1. Pass the initial moves and the number of rounds
d. Call the TheBigBangGame object’s displayResults method
1. Pass the results from the Game object
B. Game class methods
1. convertShape
a. Converts a shape name to its corresponding numeric value
2. determineLeonardsNextMove
a. Based on his last move and the outcome of the previous round
1. Refer to the Player Strategies section for more details
3. determineSheldonsNextMove
a. Based on his last move and/or the outcome of the previous round
1. Refer to the Player Strategies section for more details
4. determineWinner
a. Determine who wins a round or if a tie occurred
5. getBetterMove
a. Helps Leonard choose his next move
1. Refer to the Player Strategies section for more details
6. getLeonardsWinCount
a. Returns how many rounds Leonard won 2
7. getSheldonsWinCount
a. Returns how many rounds Sheldon won
8. getTieCount
a. Returns how many rounds Sheldon and Leonard tied
9. playGame
a. Play the specified number of rounds
b. During each round:
1. Determine the winner using the players’ current moves
2. Update the scores
3. Determine Sheldon’s and Leonard’s next moves
10. updateScore
a. Update appropriate player’s win count or tie count after each round Game Rules (refer to Figure 1)
“Scissors cuts Paper, Paper covers Rock, Rock crushes Lizard, Lizard poisons Spock, Spock smashes Scissors, Scissors decapitates Lizard, Lizard eats Paper, Paper disproves Spock, Spock vaporizes Rock, and as it always has, Rock crushes Scissors!" - Sheldon Cooper, The Big Bang Theory
Player Strategies
1. Sheldon’s Strategy
A. He selects Spock every other round
B. For rounds in which Spock is his current move
1. If he wins, he selects Rock
2. If he ties, he selects Lizard
3. If he loses, he selects Paper
2. Leonard’s Strategy
A. If he wins, he uses the same move next round
B. If he ties, he selects the better of the two moves that defeats his current move.
C. If he loses, he selects the better of the two moves that defeats Sheldon’s current move.
Additional Notes ? Use the constants defined in the UML Classes diagram to simply the code ? Do not read global variable values directly (global variable values should be passed to the methods that will use them) ?
Example Output
Note: The text, “// Command-line Arguments:”, provides the input values for each example; therefore, the line should not appear in the output of the program.
// Command-line Arguments: spock rock 4
Rock-Paper-Scissors-Lizard-Spock
Sheldon's initial move: spock
Leonard's initial move: rock
Sheldon wins!
Sheldon won 2 game(s), Leonard won 1 game(s), and they tied 1 game(s)
// Command-line Arguments: rock lizard 3
Rock-Paper-Scissors-Lizard-Spock
Sheldon's initial move: rock
Leonard's initial move: lizard
Tie Game!
Sheldon and Leonard each won 1 game(s) and tied 1 game(s)
// Command-line Arguments: paper lizard 5
Rock-Paper-Scissors-Lizard-Spock
Sheldon's initial move: paper
Leonard's initial move: lizard
Leonard Wins!
Sheldon won 0 game(s), Leonard won 5 game(s), and they tied 0 game(s)
// Command-line Arguments: spock spock 2
Rock-Paper-Scissors-Lizard-Spock
Sheldon's initial move: spock
Leonard's initial move: spock
Tie Game!
Sheldon and Leonard each won 0 game(s) and tied 2 game(s)
// Command-line Arguments: lizard spock 3
Rock-Paper-Scissors-Lizard-Spock
Sheldon's initial move: lizard
Leonard's initial move: spock
Sheldon wins!
Sheldon won 3 game(s),Leonard won 0 game(s), and they tied 0 game(s)
crushes ROCK poisonsExplanation / Answer
The base class is implemented by each of the possible selections:
User Input
The actual program
IResultWriter
The actual game
Hope this will help you!