Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task: Write a program to play hangman. In hangman, one player thinks of a word and the other tries to guess the word by guessing

image text in transcribed

Task: Write a program to play hangman. In hangman, one player thinks of a word and the other tries to guess the word by guessing one letter at a time. The guesser is allowed a fixed number of missed letters such as six; if the word is not guessed before six misses, the guesser loses. Hint: To read an input character, use this C snippet: char letter; printf("enter a letter: "); scanf(" %c", &letter); printf( "You've entered the letter %c ", letter); The prototypes for the printf () and scanf() C Standard Library functions are defined in the header file. Deliverables: A file named hangman.c containing the C source code. Input/Output: Use the following sample as a guideline: Welcome to Hangman! Try to guess the secret word one letter at a time. # misses left 6 enter a letter: E # misses left 6 enter a letter: A # misses left 5 enter a letter: I # misses left -4 enter a letter: R # misses left 4 enter a letter: 0 # misses left 3 enter a letter: N # misses left 3 enter a letter: T # misses left 3 enter a letter: L # misses left 2 enter a letter: U # misses left 1 enter a letter: P YOU LOSE! The word is STRENGTHEN word* wordEE word = * * * E * * * * E * wordE E word = * * R E * * * * E * word = * * R E * * * * E * wordREN*E N word = * T R E N * T * EN word TRENTE N word = * T R E N * T * EN

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago