Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java, the driver in is provided in the last two pictures Lab 16 Secret Word Game! objective: Write a class that will be used

In Java, the driver in is provided in the last two pictures image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Lab 16 Secret Word Game! objective: Write a class that will be used by a program driver to play a word guessing game. This game works similar to, "Hangman" where the player only has 5 tries to guess the word. They enter in a letter at a time and those letters are revealed in the word. Unlike hangman each turn counts and not just every time they pick a letter that's not in the word. First download the driver, and place it into the source folder (src) of your project. Next create a class called SecretWord This class has three instance variables o secretWord: the word the user has to guess o hintWord: the word with the guess letters revealed o numberOfTurns: keeps track of the number of guesses This class only requires a default constructor o You set the secret word o Number of turns to a default value of 0 The hint word is constructed using asterisk for every letter that's in the secret word Accessors for every instance variable Mutators for every instance variable o CHECK FOR VALID VALUES! Other methods o guess Letter: This method returns nothing and requires a single character parameter. The whenever the letter is found in the secret word, then that letter replaces that a in the hint word. HINT: The string method toCharArray may be very useful

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago