Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C#: Create a game similar to Hangman named GuessAWord in which a player guesses letters to try to replicate a hidden word. Store at

Using C#:

Create a game similar to Hangman named GuessAWord in which a player guesses letters to try to replicate a hidden word. Store at least eight words in an array, and randomly select one to be the hidden word.

Initially, display the hidden word using asterisks to represent each letter. Allow the user to guess letters to replace the asterisks in the hidden word until the user completes the entire word.

If the user guesses a letter that is not in the hidden word, display an appropriate message.

If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed.

(This problem relies on the generation of a random number. You can create a random number that is at least min but less than max using the following statements:

Random ranNumberGenerator = new Random(); int randomNumber; randomNumber = ranNumberGenerator.Next(min, max);

image text in transcribed

0 Instructions GuessAWord.cs + > 1 using System; 2 using static System.Console; 3 class GuessAWord If the user guesses a letter that is not in the hidden word, display an appropriate message. 4 { static void Main() { // Write your main here ] 6 7 8 9} 10 If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed. 6 Figure 6-27 shows a typical game in progress. Word: ********* Guess a letter >> s Sorry. s is not in the word Word: ********* Guess a letter >> e Yes! e is in the word Word: ********e Guess a letter >> r Yes! r is in the word Word: ********e Guess a letter >> a Yes! a is in the word Word: **p***a*e Guess a letter >> Figure 6-27 Typical execution of console-based GuessAWord 0 Instructions GuessAWord.cs + > 1 using System; 2 using static System.Console; 3 class GuessAWord If the user guesses a letter that is not in the hidden word, display an appropriate message. 4 { static void Main() { // Write your main here ] 6 7 8 9} 10 If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed. 6 Figure 6-27 shows a typical game in progress. Word: ********* Guess a letter >> s Sorry. s is not in the word Word: ********* Guess a letter >> e Yes! e is in the word Word: ********e Guess a letter >> r Yes! r is in the word Word: ********e Guess a letter >> a Yes! a is in the word Word: **p***a*e Guess a letter >> Figure 6-27 Typical execution of console-based GuessAWord

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

- conflict can be seen in dispute between two companies

Answered: 1 week ago

Question

define what is meant by the term human resource management

Answered: 1 week ago