COMSATS Institute of Information Technology,: Submission Deadline 4 May 2016
COMSATS Institute of Information Technology,: Submission Deadline 4 May 2016
Assignment Number 2
In this assignment you are required to develop an interactive and fun game named Words_Guesser using java. The Game works as
follows:
The Program randomly chooses a word from an Array that contains some words of different lengths and the player has to guess it.
It also selects a guess limit and informs the user respectively. The unguessed letters within the chosen word are represented as a
sequence of asterisk characters, one per letter. The User is then prompted to guess the chosen word letter by letter. If a letter that is
found within the chosen word, all the asterisks representing the letter are replaced and the partially guessed word is displayed to the
user. If the letter is not part of the chosen word, a message is displayed showing the remaining tries and all the wrong alphabets
guessed. If a correct guess is made within the limit the user wins, otherwise he loses the game. The user is displayed a message
informing him of the number of guesses used and tries left (if any). The user is then prompted if he wants to play the game again or
quit.
Use an array called "wordsList" of type String to store 10 words (minimum). These words can be any names of
your choice i.e. countries, name of cartoon characters, famous artists, singers, scientists and so on.
o You should prompt/inform the user to guess the word.
Rules of the Game:
o Winning the game: A player can win the game if she/guessed the word correctly within the permitted
tries limit allowed for each player per game.
o The words should be selected at random by the program from the "wordsList" array.
o Losing the Game: A player loses the game and game will be over if the user didn't guess the word
after limit tries.
o Results: Your program should keep track of the result (number of guesses during the game) and
number of tries left if any.
Hints:
Welcome to the Words_Guesser game Designed by (Insert Name and Reg number here), good Luck