Question: Assignment #8: Black Jack Summary: Create the Black Jack program. The solution file should be named BlackJack_ExerciseE.rb. Use the instructions on page 290 of the

Assignment #8: Black Jack

Summary: Create the Black Jack program.

The solution file should be named BlackJack_ExerciseE.rb.

Use the instructions on page 290 of the textbook.

Run your program until it works and the output looks nice.

Add the necessary documentation as described in Course Documents, and then attach your .rb file to this assignment.Assignment #8: Black Jack Summary: Create the Black Jack program. The solution

Assignment #8: Black Jack Summary: Create the Black Jack program. The solution file should be named BlackJack_ExerciseE.rb. Use the instructions on page 290 of the textbook. Run your program until it works and the output looks nice. Add the necessary documentation as described in Course Documents, and then attach your .rb file to this assignment.

290 CHAPTER 8 Object-oriented Programming 17. A(n) variable's scope is accessible to all instances of the same class a. Local b. Global C. Instance Class 18. The d method determines whether a variabie exists, returning a value of true if the variable is found. 19. Using the method, you can reverse the onder in which arrays are retrieved. 20. s a keyword that can be used as a shorthand a way of referring to the current object. Reinforcement Exercises The following exercises are designed to further your understanding of Ruby programming by challenging you to make improvements tothe chapters game project, the Rock, Paper, Scissors game. 1. Currently, the Game class's get player move method uses a regular expression to validate the player's moves of Rock. Paper, or Scissors, rejecting any input other than one of these words. Making the player enter entire words takes time and can lead to typos, however. Simplify game play by modifying the get player move method to also allow single- character input in the form of R, P, and S. Make sure you accommodate both uppercase and lowercase input. 2. The game allows players to play an unlimited number of times. To help them keep track of how many times they have played, modify the game by adding a global variable named Sgamecount at the beginning of the program's Main Script Logic area, assigning it an initial value of 0. Next add a method named game count and set it to increment the value of sgamecoun t each time it is executed. Lastly, add a statement to the play game method that executes the 290 CHAPTER 8 Object-oriented Programming 17. A(n) variable's scope is accessible to all instances of the same class a. Local b. Global C. Instance Class 18. The d method determines whether a variabie exists, returning a value of true if the variable is found. 19. Using the method, you can reverse the onder in which arrays are retrieved. 20. s a keyword that can be used as a shorthand a way of referring to the current object. Reinforcement Exercises The following exercises are designed to further your understanding of Ruby programming by challenging you to make improvements tothe chapters game project, the Rock, Paper, Scissors game. 1. Currently, the Game class's get player move method uses a regular expression to validate the player's moves of Rock. Paper, or Scissors, rejecting any input other than one of these words. Making the player enter entire words takes time and can lead to typos, however. Simplify game play by modifying the get player move method to also allow single- character input in the form of R, P, and S. Make sure you accommodate both uppercase and lowercase input. 2. The game allows players to play an unlimited number of times. To help them keep track of how many times they have played, modify the game by adding a global variable named Sgamecount at the beginning of the program's Main Script Logic area, assigning it an initial value of 0. Next add a method named game count and set it to increment the value of sgamecoun t each time it is executed. Lastly, add a statement to the play game method that executes the

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!