/** * * Runs the RandGuessGame. Creates an instance of RandGuessGame and calls u
ID: 2247791 • Letter: #
Question
/**
*
* Runs the RandGuessGame. Creates an instance of RandGuessGame and calls upon its methods to conduct the game.
* <br><strong>RandGuessGame methods called in order:</strong><br>
* populateArray<br>
* outputArray (passing true to hide values)<br>
* playerGuess<br>
* getResult<br>
* outputArray (passing false to show all values)<br>
*
*/
public class GameDriver
{
/**
* Main method which creates instance of RandGuessGame and executes its methods.
* @param args Command line arguments (Unused)
*/
public static void main(String[] args)
{
//Generate instance of game
//Conduct game behaviors
}
}
Explanation / Answer
public class GameDriver
{
/**
* Main method which creates instance of RandGuessGame and executes its methods.
* @param args Command line arguments (Unused)
*/
public static void main(String[] args)
{
//Generate instance of game
RandGuessGame obj = new RandGuessGame(); //Instance generated
//Conduct game behaviors
obj.populateArray();
obj.outputArray(false); // To show all values
obj.playerGuess();
obj.getResult();
obj.outputArray(false); // To show all values
// All functions of RandGuessGame called
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.