Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
Question
Book Icon
Chapter 6, Problem 10E
Program Plan Intro

Program plan:

  • Create a class Program under namespace GuessAWord.
  • Declare two variables wrongGuessChance and lettersLeft of type int.
  • Define the following functions inside the class:
    • Define a function getGuessWord: This function store eight words in array words and use Random class to pick a random word from this array and return it.
    • Define a function hideWord: This function takes as input the randomly selected word and masks it by using asterisks.
    • Define a function DisplayCharacters: This function displays the remaining unguessed letters of the guessing word.
    • Define a function testGuess: This function takes the userLetter, word and characters array as a parameter. This function then uses for loop to check if the userLetter matches with any of the letters of guessWord. If yes it changes the masked guessWord, else it displays the message for the wrong guess and reduces the guessing chances.
    • Define main functions and call the above functions in order to generate the guessing game.

Program Description: The following program will create a word guessing game named as GuessAWord.

Blurred answer
Students have asked these similar questions
Pls, explain how this program question applies to the code below and comment on it in the program. for example, comment the which part of the question applies to the code and how it works
Use Java programming language Write a program that asks the user to enter 5 test grades (use an array to store them). Output the grades entered, the lowest and highest grade, the average grade, how many grades are above the average and how many are below and the letter grade for the average grade. Create a method that returns the lowest grade. Create a method that returns the highest grade. Create a method that returns the average grade. Create a method that returns how many grades were above the average. Create a method that returns how many grades were below the average. Create a method that returns the letter grade of the average (90-100 – A, 80-89 – B, 70-79 – C, < 70 – F)
Word Sleuth Puzzle Program
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning