Exercise 2-1 The following exercises are designed to further your understanding of Ruby programming by challenging...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Exercise 2-1 The following exercises are designed to further your understanding of Ruby programming by challenging you to make improvements to the chapter's game project, the Ruby Tall Tale game. 1. As currently designed, the Ruby Tall Tale game collects from the player five pieces of information that are used as input in the creation of the game's story. As a result, there is a limit to how dynamic the story can be. Review the story, and look for opportunities to replace other keywords with user input. To implement this challenge, you will have to add programming logic that prompts the player for additional input and then incor- porates that input into the story's text via embedded variables. 2. As a programmer, it is important to take credit for your hard work. Add a paragraph to the end of the story that provides the player with a little information about the game and its author. Add your URL as well. If you do not have a URL, use your school's URL. To implement this modification, add a fifth paragraph to the end of the story and then add statements to the end of the script that display the paragraph and pause execution to give the player a chance to read it. 3. Add a transitional message between the collection of story input and the telling of the story that lets the player know that input collection is done and that the game is ready to tell the story. To do so, you need to clear the console window and then display the transitional text. porates that input into the story's text via embedded variables. 2. As a programmer, it is important to take credit for your hard work. Add a paragraph to the end of the story that provides the player with a little information about the game and its author. Add your URL as well. If you do not have a URL, use your school's URL. To implementis modification, add a fifth paragraph to the end of the story and then add statements to the end of the script that display the paragraph and pause execution to give the player a chance to read it. 3. Add a transitional message between the collection of story input and the telling of the story that lets the player know that input collection is done and that the game is ready to tell the story. To do so, you need to clear the console window and then display the transitional text. 4. Modify the program so that the message that's displayed when the player elects not to play the game is also displayed at the end of the story. To do so, insert additional text messages using puts statements just before the else keyword in the Main Script Logic section. 5. As currently written, the game prompts the player to enter n to quit and y to play. If n is entered, the game halts. However, if anything else is entered, or if the Enter key is pressed with nothing entered, the game resumes. Change the game so that it can only be played when the player enters y. Do this by replacing the first set of script statements that follows with the second set of script statements that follows. Exercise 2-1 The following exercises are designed to further your understanding of Ruby programming by challenging you to make improvements to the chapter's game project, the Ruby Tall Tale game. 1. As currently designed, the Ruby Tall Tale game collects from the player five pieces of information that are used as input in the creation of the game's story. As a result, there is a limit to how dynamic the story can be. Review the story, and look for opportunities to replace other keywords with user input. To implement this challenge, you will have to add programming logic that prompts the player for additional input and then incor- porates that input into the story's text via embedded variables. 2. As a programmer, it is important to take credit for your hard work. Add a paragraph to the end of the story that provides the player with a little information about the game and its author. Add your URL as well. If you do not have a URL, use your school's URL. To implement this modification, add a fifth paragraph to the end of the story and then add statements to the end of the script that display the paragraph and pause execution to give the player a chance to read it. 3. Add a transitional message between the collection of story input and the telling of the story that lets the player know that input collection is done and that the game is ready to tell the story. To do so, you need to clear the console window and then display the transitional text. porates that input into the story's text via embedded variables. 2. As a programmer, it is important to take credit for your hard work. Add a paragraph to the end of the story that provides the player with a little information about the game and its author. Add your URL as well. If you do not have a URL, use your school's URL. To implementis modification, add a fifth paragraph to the end of the story and then add statements to the end of the script that display the paragraph and pause execution to give the player a chance to read it. 3. Add a transitional message between the collection of story input and the telling of the story that lets the player know that input collection is done and that the game is ready to tell the story. To do so, you need to clear the console window and then display the transitional text. 4. Modify the program so that the message that's displayed when the player elects not to play the game is also displayed at the end of the story. To do so, insert additional text messages using puts statements just before the else keyword in the Main Script Logic section. 5. As currently written, the game prompts the player to enter n to quit and y to play. If n is entered, the game halts. However, if anything else is entered, or if the Enter key is pressed with nothing entered, the game resumes. Change the game so that it can only be played when the player enters y. Do this by replacing the first set of script statements that follows with the second set of script statements that follows.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
The following exercises are designed to help solidify your understanding of inverse, exponential, and logarithmic functions from Sections. Determine whether the functions in each pair are inverses of...
-
The following exercises are designed to help solidify your understanding of inverse, exponential, and logarithmic functions from Sections. Determine whether the functions in each pair are inverses of...
-
The following exercises are designed to help solidify your understanding of inverse, exponential, and logarithmic functions from Sections. Determine whether the functions in each pair are inverses of...
-
What has been the trend in sales over the years presented? July 29, July 30, 2023 2022 (Unaudited) (Unaudited) Net sales $ 5,164,072 100.0% $ 4,643,014 100.0% Cost of sales 3,115,603 60.3% 2,773,824...
-
Consider two Italian restaurants located in identical towns 200 miles apart. The restaurants are identical in every respect but their tipping policies. At one, there is a flat $15 service charge, but...
-
A paracentric inversion a. includes the centromere within the inverted region. b. does not include the centromere within the inverted region. c. has two adjacent inverted regions. d. is an inverted...
-
Hemlock Semiconductor Operations, LLC, and SolarWorld Industries Sachsen GmbH, are both companies involved in the manufacture of components for solar power products. Prior to the lawsuit, the two...
-
In the audit of Price Seed Company for the year ended September 30, the auditor set a tolerable misstatement of $50,000 at an ARIA of 10%. A PPS sample of 100 was selected from an accounts receivable...
-
What is JDBC ? Explain the role of Driver in JDBC. What is the purpose Class.forName method ? What is the advantage of PreparedStatement over Statement ? What is the use of CallableStatement ? Name...
-
Questions : How can you provide Acme with more space in their facility to accommodate growth in the short term? 2. From an operational aspect how can Acme overcome the issues of lost online sales to...
-
A professor is interested in determining the impact of hours worked per day by students (variable X) on final quiz scores (Y). A random sample of ten students is taken with the following results on X...
-
QUESTION 16/30 SELECT ID, name, dept_name, salary * 1.1 WHERE instructor; The query given below will not give an error. Which one of the following has to be replaced to get the desired output? A B C...
-
1 . 1 . Create a new exception class called BadPass that has a default ( ( no argument constructor ) ) and a constructor that takes a String message. Write a program Get Passwords that asks for a...
-
QUESTION 18/30 What is the correct syntax for updating a table in SQL shell? A B C D UPDATE table_name SET column1=value1, column2=value2 WHERE condition; MODIFY table_name SET column1=value1,...
-
Which statement is correct regarding relaxed - heap or weak - heap. Group of answer choices Each node is larger than the its child node Value of each right child is larger than its parent node...
-
14 ints Check my work mode: This shows what is correct or incorrect for the work you have completed so far. It does not indicate completion. The Eldorado Corporation's controller prepares adjusting...
-
Nortex Chemicals, Inc. is involved in the natural gas processing industry in the Texas Panhandle. One of its primary operations involves purchasing large tanks, each roughly the size of a rail car,...
-
Provide a draft/outline of legal research involving an indigenous Canadian woman charged with assault causing bodily harm under (Sec 267b) of the Criminal Code, where the crown wants a 12-month jail...
-
To help familiarize you with the financial reporting of a real company in order to further your understanding of the chapter material you are learning. Although we do not have access to the journals...
-
On April 1, Miracle Applications paid $1,500,000 to acquire a patent on software. Miracle Applications expects the patent to have a useful life of 4 years. Requirements 1. Journalize the entry to...
-
Journalize the adjusting entry needed at March 31, the fiscal year-end, for each of the following independent situations. No other adjusting entries have been made for the year. a. On February 1, we...
-
Prove the second part of Theorem 3.8. That is let \(\left\{X_{n}ight\}_{n=1}^{\infty}\) be a sequence of random variables, \(X\) be a random variable, and \(g\) be a Borel function on \(\mathbb{R}\)....
-
Prove the first part of Theorem 3.7. That is let \(\left\{X_{n}ight\}_{n=1}^{\infty}\) be a sequence of random variables, \(c\) be a real constant, and \(g\) be a Borel function on \(\mathbb{R}\)...
-
Let \(\left\{X_{n}ight\}_{n=1}^{\infty},\left\{Y_{n}ight\}_{n=1}^{\infty}\), and \(\left\{Z_{n}ight\}_{n=1}^{\infty}\) be independent sequences of random variables that converge in probability to the...
Study smarter with the SolutionInn App