Write a program to simulate the LetterboxLinks to an external site. game show. For our program, the game is more simplified and is played as follows: The program selects a random word for the user to guess. The user guesses one letter at a time until either they guess the word, or they run out of guesses. The word to guess has 5 letters. ----- Available letters: abcdefghijklmnopqrstuvwxyz 7 incorrect guesses remaining Please enter your guess: s s is not in the word. Too bad. 6 incorrect guesses remaining. ----- Available letters: abcdefghijklmnopqr tuvwxyz 6 incorrect guesses remaining. Please enter your guess: e Nice! e is in the word. -e--- Available letters: abcd fghijklmnopqr tuvwxyz 6 incorrect guesses remaining. Please enter your guess: r r is not in the word. Too bad. 5 incorrect guesses remaining. -e--- Available letters: abcd fghijklmnopq tuvwxyz 5 incorrect guesses remaining. Please enter your guess: r r is not an available letter -e--- Available letters: abcd fghijklmnopq tuvwxyz 5 incorrect guesses remaining. Please enter your guess: l Nice! l is in the word. -ell- Available letters: abcd fghijk mnopq tuvwxyz 5 incorrect guesses remaining. Please enter your guess: h Nice! h is in the word. hell- Available letters: abcd fg ijk mnopq tuvwxyz 5 incorrect guesses remaining. Please enter your guess: o Nice! o is in the word. Congrats, you guessed the word hello! ----------Apply the three file format.-------- main.cpp letterbox.cpp letterbox.h Read words for the user to guess into an array of strings from a file. Create a text file words.txt. This file MUST contain at least 10 words but no more than 100 words, one word per line, and each word can have a maximum of 12 characters. The program must work with any file named words.txt that has from 10 to 100 words. You MUST write in-line comments to explain sections of your code to increase its readability.  You MUST also write function header comments for all your functions. Follow the format taught in the lecture and lab. Describe what the function does, a description of each parameter if needed and a description of what the function returns if needed.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 15E
icon
Related questions
Question

Write a program to simulate the LetterboxLinks to an external site. game show. For our program, the game is more simplified and is played as follows:

  1. The program selects a random word for the user to guess.
  2. The user guesses one letter at a time until either they guess the word, or they run out of guesses.

The word to guess has 5 letters.

-----

Available letters: abcdefghijklmnopqrstuvwxyz

7 incorrect guesses remaining

Please enter your guess:

s

s is not in the word. Too bad. 6 incorrect guesses remaining.

-----

Available letters: abcdefghijklmnopqr tuvwxyz

6 incorrect guesses remaining.

Please enter your guess:

e

Nice! e is in the word.

-e---

Available letters: abcd fghijklmnopqr tuvwxyz

6 incorrect guesses remaining.

Please enter your guess:

r

r is not in the word. Too bad.

5 incorrect guesses remaining.

-e---

Available letters: abcd fghijklmnopq tuvwxyz

5 incorrect guesses remaining.

Please enter your guess:

r

r is not an available letter

-e---

Available letters: abcd fghijklmnopq tuvwxyz

5 incorrect guesses remaining.

Please enter your guess:

l

Nice! l is in the word.

-ell-

Available letters: abcd fghijk mnopq tuvwxyz

5 incorrect guesses remaining.

Please enter your guess:

h

Nice! h is in the word.

hell-

Available letters: abcd fg ijk mnopq tuvwxyz

5 incorrect guesses remaining.

Please enter your guess:

o

Nice!

o is in the word.

Congrats, you guessed the word hello!

----------Apply the three file format.--------

  1. main.cpp
  2. letterbox.cpp
  3. letterbox.h

Read words for the user to guess into an array of strings from a file. Create a text file words.txt. This file MUST contain at least 10 words but no more than 100 words, one word per line, and each word can have a maximum of 12 characters. The program must work with any file named words.txt that has from 10 to 100 words.

  • You MUST write in-line comments to explain sections of your code to increase its readability.

  •  You MUST also write function header comments for all your functions. Follow the format taught in the lecture and lab. Describe what the function does, a description of each parameter if needed and a description of what the function returns if needed.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,