Question: This project will be a number guessing game coded in C# where the program picks a number and allows the user a certain number of

This project will be a number guessing game coded in C# where the program picks a number and allows the user a certain number of attempts to guess it.

Requirements:

On startup, the program asks the user to select a difficulty (easy, medium, hard).

Easy range = 1-10, max attempts = 5

Medium range = 1-50, max attempts = 5

Hard range = 1-100, max attempts = 5

The ranges are inclusive.

Once the difficulty selection is made, the program randomly chooses a number and prompts the user for a guess.

Your program must validate inputs are valid for the current game (i.e. the input is numeric and within the possible range of values to guess for that level of difficulty). If the input is not valid, the program must inform the user and re-prompt until it receives a good response.

The program must keep track of the values guessed for the current game. If a user enters a value previously guessed during this round, the user should be informed of the mistake and allowed to make a new guess. If a guess is invalid or is a repeat of a previous guess, the number of attempts left does NOT decrease.

The values guessed reset with every new game.

After each guess, the program informs the user that the attempt is correct, too low, or too high.

The program should display the number of remaining attempts at all times during the game.

Once the user runs out of attempts or makes a correct guess, the game ends and declares the results of the game (win or loss, number of attempts made).

The program should ask the user if they would like to play another game.

Yes - The program loops back to the difficulty selection and continues from there.

No The program ends.

What youll need

Reading from and writing to the Console

Using the Random class

Parsing input from string to int

Using loops

Using collections (lists or arrays)

Comparing primitive values

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!