Question: please answer in java Background: When you design a piece of software, you often don't consider that the users may not speak the same language

please answer in java  please answer in java Background: When you design a piece of
software, you often don't consider that the users may not speak the
same language you do. Companies who wish to ship their software to
different countries will need to internationalize their applications. Typically this is done
by translating all strings used in the interface to the various languages.

Background: When you design a piece of software, you often don't consider that the users may not speak the same language you do. Companies who wish to ship their software to different countries will need to internationalize their applications. Typically this is done by translating all strings used in the interface to the various languages. In this lab, you'll be writing a number guessing game. The game will pick a random number between 0 and 100. You'll prompt the user to enter their guess and you'll let them know if they guessed too high, too low, or if they guessed correctly. You'll allow them to keep guessing until they reach the correct answer. The game can be played in English, Spanish, French or Simplified Chinese To avoid writing four different versions of this software, you will leverage OOP and Polymorphism to provide the strings from each language. You'll start with a language class. It will have abstract methods for every possible string you may use in your interface. Then you'll create English, Spanish, French and Simplified Chinese classes which will override the abstract class' methods and return the appropriate string. Classes you must create: Define an abstract Language class It should have 4 abstract methods all of which should return a string: omake_guess() o too_low) too_high) correct() Define a class called English which inherits from Language. Define a class called Spanish which inherits from Language. Define a class called French which inherits from Language. Define a class called Simplified Chinese which inherits from Language. . Each class will need to override all 4 inherited methods and each should return a string as per the table on the next page. Hint: You'll probably want to copy and paste the strings from each language: Language make_guess() too_low too_high correcto English Guess a number Too Low Too High Correct Spanish Adivina un numero Demasiado bajo Demasiado alto correcto French Devinez un nombre Trop bas Simplified #-12* Chinese Al translations above are from google translate Trop haut Correct Define a class called GuessNumber. It must have a method called play game) This method will first pick a random number between 0 and 100. In java: Add "import java.util. Random at the top of this class Random myRand = new Random(): myRand.nextInt(100): In C# Random myRand = new Random(): myRand.Next(100); Prompt the user to select a language to play in: Choose your language . 1. English 2 Espanol 3. Franais 4. *** If the user selects English, using polymorphism, create a variable of type Language and instantiate an English object on it. If the user selects French, do the same with a variable of type Language with a new French object on it, etc... Using the object you created in the last step. prompt the user to enter their guess. If your object was called myLang, you should be able to just type: print(myLang, make_guess()); This will call the make_guess() method in the appropriate language that returns a string, which you can then print. Read in the user's guess. If it's too high, too low or correct, give them the appropriate prompt in the appropriate language. Driver Program: In your main method, simply make an instance of GuessNumber and call play game) on it Sample Output: Choose your language 1. English 2. Espaol 3. Franais 4. *** 1 Guess a number 50 Too High Guess a number 25 Too Low Guess a number 33 Too Low Guess a number 40 Too Low Guess a number 45 Too Low Guess a number 48 Too Low Guess a number 49 Correct [Separate run] Choose your language 1. English 2. Espaol 3. Franais 4. 4 50 75 85 80 77 76 Rubric: Language Class (15 points total) o Declared abstract (2 points) o 4 correctly declared abstract methods (make_guess, too_high, too_low, correct) (3 points each) English Class (15 points total) 4 correctly declared concrete methods (make_guess, too_high, too_low, correct) (3 points each) Each returns the appropriate string (2 points total) French Class (15 points total) o 4 correctly declared concrete methods (make_guess, too_high, too_low, correct) (3 points each) Each returns the appropriate string (2 points total) Spanish Class (15 points total) 4 correctly declared concrete methods (make_guess, too_high, too_low, correct) (3 points each) Each returns the appropriate string (2 points total) Simplified Chinese Class (15 points total) o 4 correctly declared concrete methods (make_guess, too_high, too_low, correct) (3 points each) Each returns the appropriate string (2 points total) Guess Number Class (20 points total) o Successfully picks a random number (2 points) o Prints out the language choice menu and gets users choice (3 points) o Uses if statements to instantiate correct language object (5 points) o Prompts user for guess in correct language (5 points) Correctly tells the user if too high or low or correct (5 points) Main Class (5 points total) o Correctly instantiates Guess Number (3 points) Correctly calls play game() (2 points) Note: If a user has problems printing chinese characters due to character set issues, don't take off points for that

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!