Question: Letter Guessing Game C# Programing Directions: In this programming project, you will create a C# console application game of the classic letter guessing game. The

Letter Guessing Game

C# Programing

Directions:

In this programming project, you will create a C# console application game of the classic letter guessing game. The computer will generate a random letter in the English alphabet and the user will have to guess the letter with a limited number of attempts. In order to create this program, you need to use Microsoft Visual Studio.

The program will have the following flow:

  1. Program will welcome user to the game and display the rules.
  2. User will be asked to enter a letter.
  3. The letter will be compared with the solution the computer generated. If the letter does not match, the computer will determine if the guess came before or after the solution.
  4. Program will determine if user won the round. If user won, a congratulations message is displayed. If the user didnt win, program will allow user to guess again if not all attempts were used. If the user used all guesses for the round, the program will display the answer.
  5. Program will ask user if another will round will be played. If user selects yes, another round begins and repeat previous steps. If user selects no, a goodbye message is displayed and program terminates.

Requirements:

  1. Each round will allow up to 5 guesses.
  2. Program must use loops to keep track of limits and rounds.
  3. The program logic will run in the main method. You do not need to create user defined methods.

This will be graded through the Microsoft Visual Studio 2019 Compiler. If it does not compile, it does not work properly!

Here are some tips and tricks that will help you with this assignment and make the experience enjoyable.

  • Do not try to write out all the code and build it at the end to find syntax errors. For each new line of code written (my rule of thumb is 2-3 lines), build it to see if it compiles successfully. It will go a long way!
  • After any successful build, run the code to see what happens and what current state you are at with the program writing so you know what to do next! If the program performs what you expected, you can then move onto the next step of the code writing. If you try to write everything at once and build it successfully to find out it doesnt work properly, you will get frustrated trying to find out the logical error in your code! Remember, logical errors are the hardest to fix and identify in a program!
  • Start the assignment early! Do not wait last minute (the day of) to begin the assignment.
  • Ask questions! Its ok to ask questions. If there are any clarifications needed, please ask (through email or the discussion board)!

Hints for this particular assignment to consider:

  • To generate random numbers check out this link: https://www.tutorialspoint.com/generating-random-numbers-in-chash
  • You will have convert numbers to the respective letter in the alphabet when generating the letter. Take a look at https://www.rapidtables.com/code/text/ascii-table.html for the respective number that represent a letter. The letter a uses 97 and z uses 112. Use explicit conversion!
  • When reading input, you will have to use explicit conversion to compare char values.
  • Use Loops!

SAMPLE OUTPUT:

Welcome to the Letter Guessing Game! I will pick a letter between a-z and you will have to guess the letter. You have 5 guesses per round. Ready to play? Here we go! ****************************************************** Round 1 Guess 1 Enter your guess: A You picked a The letter you picked comes before my letter in the alphabet. Guess 2 Enter your guess: t You picked t The letter you picked comes before my letter in the alphabet. Guess 3 Enter your guess: v You picked v The letter you picked comes before my letter in the alphabet. Guess 4 Enter your guess: x You picked x The letter you picked comes after my letter in the alphabet. Guess 5 Enter your guess: w You picked w You guessed the correct letter! Congratulations! You won the round! Would you like to play again? Y or N: y ****************************************************** Round 2 Guess 1 Enter your guess: m You picked m The letter you picked comes before my letter in the alphabet. Guess 2 Enter your guess: X You picked x The letter you picked comes after my letter in the alphabet. Guess 3 Enter your guess: P You picked p The letter you picked comes before my letter in the alphabet. Guess 4 Enter your guess: q You picked q The letter you picked comes before my letter in the alphabet. Guess 5 Enter your guess: s You picked s The letter you picked comes before my letter in the alphabet. Sorry. All your guesses were used. The letter was t Would you like to play again? Y or N: n ****************************************************** Thanks for playing! Press any key to continue . . .

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!