Question: java please Define a class called GuessNumber. It must have a method called play _ game ( ) This method will first pick a random

java please
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:
Chooseyour language
English
Espaol
Franais
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:
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.

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!