C++   How to Program (Early Objects Version)
C++ How to Program (Early Objects Version)
10th Edition
ISBN: 9780134448824
Author: Paul Deitel; Harvey M. Deitel
Publisher: Pearson Education (US)
bartleby

Videos

Textbook Question
100%
Book Icon
Chapter 21, Problem 21.11E

(Hangman Game) Write a program that plays the game of Hangman. The program should pick a word (which is either coded directly into the program or read from a text file) and display the following:
Guess the word:   XXXXXX
Each X represents a letter. The user tries to guess the letters in the word. The appropriate response yes or no should be displayed after each guess. After each incorrect guess, display the diagram with another body part filled. After seven incorrect guesses, the user should be hanged. The display should look as follows:
0
/|\
I
/ \

After each guess, display all user guesses. If the user guesses the word correctly, display Congratulations!!! You guessed my word. Play again? yes/no

Blurred answer
Students have asked these similar questions
Python: VOWEL OR CONSONANT Challange   Ask the user to input a word.  The program will then tell them how many letters are in the inputted word.  It will also tell them how many vowels and consonants are in the word.  It will then ask which number (between 1- the length of their word - DO NOT USE THE PLACEHOLDER ZERO) that they would like to pick.  It will then tell them whether that letter is a vowel or consonant.  Next the program will pick a random letter from the word that was inputted, print that letter and tell the user whether it is a vowel or consonant:   OUTPUT: What is your word?:  Larry There are 5 letters in Larry.   There are 1 vowel and 4 consonants For your word, L is  "1" and Y is  "5" Which letter do you want 1-5? 4 The letter you picked is an "r" and that letter is a CONSONANT and there are two of them I picked a random letter from your word, it is "a" The letter I randomly picked is a VOWEL   Remember :  vowels are "a, e, i, o, u"  a "y",should output as "…
15. Speed Conversion ChartYour friend Amanda, who lives in the United States, just bought an antique European sports car. The car’s speedometer works in kilometers per hour. The formulafor converting kilometers per hour to miles per hour is:MPH = KPH * 0.6214In the formula, MPH is the speed in miles per hour and KPH is the speed in kilometersper hour. Amanda is afraid she will get a speeding ticket, and has asked you to write aprogram that displays a list of speeds in kilometers per hour with their values convertedto miles per hour. The list should display the speeds from 60 kilometers per hourthrough 130 kilometers per hour, in increments of 5 kilometers per hour. (In otherwords, it should display 60 kph, 65 kph, 70 kph, and so forth, up through 130 kph.)   made in visual studio 2017
Use Pycharm
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming Tutorial 36 - Intro to Loops; Author: Caleb Curry;https://www.youtube.com/watch?v=M3o7Y0juEP0;License: Standard YouTube License, CC-BY