RAM DESCRIPTION: You will create a C++ program that will allow the user to play the game Hangman. Hangman is traditionally a paper & pench One player thinks of a word and the other player tries to guess it by suggesting letters that may be in the word. Your program will be player one, by pulling a word from a "word bank" and then player two is the user of your program. The game is over when one or two things happen: The user correctly completes the word. The user incorrectly guesses a letter six times. + ARRAYS oefore Majoresop torunagain. Comment You will have four arrays. Three of the arrays will be C-Strings: Character array of size 21 (20 characters plus one null-terminator) that will hold the word read in from the "word bank". You may assume that the game only plays with words, not phrases. (No spaces). char word[21]; rom word bank Character array of size 21 (20 characters plus one null-terminator) that will at first hold all underscores. Then, as the user makes correct guesses, the underscores will be replaced with the correct letters. This means you will have to initialize this array to all underscores before the user makes any guesses. char underScores[21]; Hof underscores for the word. Character array of size 27 (26 characters plus one null-terminator). Initialize this array when you define it to all the uppercase letters in the alphabet. "ABCDEFGHIJKLMNOPQRSTUVWXYZ". char alphabet[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Boolean array of size 26 (26 boolean values). This array will have a true/false toggle for each letter of the alphabet. If the user has guessed the letter B, then this array at element 1 will have the value of true. This array will also need to be initialized to all false before the user makes any guesses. bool userGuesses[26]; WORD BANK You will have an input file called wordBank.txt. You need to manually type in TEN or more words to this file. Your program will not be outputting to this file. wordBank.txt will be used as an input file only. LDalu CAPS * FUNCTION: INT MAIN() Open the input file wordBank.txt. If the file can't open, print out a message that a word could not be found in the word bank. Allow the user to play this game (run the program) multiple times. -while looP SETTING UP FOR THE GAME nent Set all the elements of the userGuesses array to false Using a loop, set all elements of the underScores array to the underscore character Set the stage variable to zero (the starting stage) Read in a word from the input file (get the word)- make sure that if the user runs the program multiple times that they get a different word each time from the file. romment 2och AME PLAY onother eto play
RAM DESCRIPTION: You will create a C++ program that will allow the user to play the game Hangman. Hangman is traditionally a paper & pench One player thinks of a word and the other player tries to guess it by suggesting letters that may be in the word. Your program will be player one, by pulling a word from a "word bank" and then player two is the user of your program. The game is over when one or two things happen: The user correctly completes the word. The user incorrectly guesses a letter six times. + ARRAYS oefore Majoresop torunagain. Comment You will have four arrays. Three of the arrays will be C-Strings: Character array of size 21 (20 characters plus one null-terminator) that will hold the word read in from the "word bank". You may assume that the game only plays with words, not phrases. (No spaces). char word[21]; rom word bank Character array of size 21 (20 characters plus one null-terminator) that will at first hold all underscores. Then, as the user makes correct guesses, the underscores will be replaced with the correct letters. This means you will have to initialize this array to all underscores before the user makes any guesses. char underScores[21]; Hof underscores for the word. Character array of size 27 (26 characters plus one null-terminator). Initialize this array when you define it to all the uppercase letters in the alphabet. "ABCDEFGHIJKLMNOPQRSTUVWXYZ". char alphabet[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Boolean array of size 26 (26 boolean values). This array will have a true/false toggle for each letter of the alphabet. If the user has guessed the letter B, then this array at element 1 will have the value of true. This array will also need to be initialized to all false before the user makes any guesses. bool userGuesses[26]; WORD BANK You will have an input file called wordBank.txt. You need to manually type in TEN or more words to this file. Your program will not be outputting to this file. wordBank.txt will be used as an input file only. LDalu CAPS * FUNCTION: INT MAIN() Open the input file wordBank.txt. If the file can't open, print out a message that a word could not be found in the word bank. Allow the user to play this game (run the program) multiple times. -while looP SETTING UP FOR THE GAME nent Set all the elements of the userGuesses array to false Using a loop, set all elements of the underScores array to the underscore character Set the stage variable to zero (the starting stage) Read in a word from the input file (get the word)- make sure that if the user runs the program multiple times that they get a different word each time from the file. romment 2och AME PLAY onother eto play
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
I am trying to write this
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 4 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY