Reference no: EM133218343
To complete this challenge you will need create two classes and a variety of methods.
Create Console Application in Visual Studio, named: Game
Add a new class file named: HighLow
Include header comments: Name, Date, Course, and Synopsis in both classes
The Main() method is the primary entry point to the application, but that is all it needs to be. We want to separate the game itself from the game construct ( the program class ) that could be reused when developing other games... another reason why the application/namespace listed above is simply Game.
Program.cs
Question 1: While the user wants to keep playing... call a method that plays HighLow
Question 2: Create another method asking the user if they would like to play again. This can be called after the HighLow game is played.
HighLow.cs
The overall flow of the game can be contained in the method called from Program, using additional methods to perform specific processes.
Display the game title and instructions
Request a maximum number
Create a method to validate this number, asking again if necessary
Generate a random number between 1 and the maximum for the user to guess.
Until the user has won:
Prompt the player for a guess... Reusing the previously created method to validate the user's response
Create another method to compare player's guess to generated random number. If incorrect, provide the user a hint of: "too low" or "too high."
Create one more method to calculate a score.
Display the answer and score after a correct guess