You have been asked to create a guessing game with four players. The players will be asked to guess which word will be selected next and earn points for each correct guess." The game works as follows: First: At the start of the game: Each of the four players is asked to enter their name and the amount of money they wish to bet on the game (only positive values less than $100 are allowed). The total of all four bets is the price money for the game. •The players will be asked to select which set of words they wish to use for the game. The options are: Fruit Colors Animals Each set of words must have at least seven options (You may choose your own words for each set). Once the players select a set of words the computer will display the full list of options. For example: You have selected the Fruit word set. The possible words are: Apple, Orange, Banana, Kiwi, Strawberry, Grape, Cherry Second: Each game will consist of seven rounds. Each round goes as follows: Each player is asked to pick a word from the set of words selected. Two or more player may choose the same word. The computer will then randomly choose a word to select and display the word to the players. For example: The word is: Kiwi If a player guessed the correct word they will earn one point. Third: After all seven rounds are played: The player with the most points is declared the winner. The computer will display the winner's name and the amount of money they have won. For example: Congratulations Megan, you are the winner. You have won $60.00. If there is a tie: The price money is divided evenly between each of the winning players. The winners' names and the amount of money they won (per player) will be displayed. For examples: Congratulations Anne, Bob and Clara, you are the winners. You have each won $20.00. The computer will then record the game in the file GuessGameRecord.txt. The file will contain a record for each game played using the program. A game record should include the word set select, the total of the bets, the name/s of the winner/s and the amount each winner/s won For example: Fruit 60.00 Anne, Bob, Clara 20.00 Remember, the program should not delete the current contents of the file. Instead, it should add the current game to the end of the file. . Fourth: The players will then be asked if they want be play again: If yes, the players will be asked to enter new bets (they will not need to re-enter their names) and the game will start with the players select the set of words. If no, the computer will close the program . Fifth: You will create a Java application that implements this card game. Save your program in the file WordGuessing Game.java. Your program must use at least three unique methods (though you are encouraged to use more) to implement the game. Each method must have a documentation (JavaDoc, /**) comment which describes how to use the method. Remember to use @param and @return when needed. Your program must include input validation for the user inputs (where required). Use descriptive variable and method names throughout your program, along with good programming style.
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
"You have been asked to create a guessing game with four players. The players will be asked to guess which word will be selected next and earn points for each correct guess."
The game works as follows:
First: At the start of the game:
Each of the four players is asked to enter their name and the amount of money they wish to bet on the game (only positive values less than $100 are allowed). The total of all four bets is the price money for the game.
•The players will be asked to select which set of words they wish to use for the game. The options are:
Fruit
Colors
Animals
Each set of words must have at least seven options (You may choose your own words for each set). Once the players select a set of words the computer will display the full list of options.
For example:
You have selected the Fruit word set. The possible words are: Apple, Orange, Banana, Kiwi, Strawberry, Grape, Cherry
Second: Each game will consist of seven rounds. Each round goes as follows:
Each player is asked to pick a word from the set of words selected. Two or more player may choose the same word.
The computer will then randomly choose a word to select and display the word to the players. For example:
The word is: Kiwi
If a player guessed the correct word they will earn one point.
Third: After all seven rounds are played:
The player with the most points is declared the winner. The computer will display the winner's name and the amount of money they have won.
For example:
Congratulations Megan, you are the winner. You have won $60.00.
If there is a tie:
The price money is divided evenly between each of the winning players. The winners' names and the amount of money they won (per player) will be displayed.
For examples: Congratulations Anne, Bob and Clara, you are the winners. You have each won $20.00.
The computer will then record the game in the file GuessGameRecord.txt. The file will contain a record for each game played using the program.
A game record should include the word set select, the total of the bets, the name/s of the winner/s and the amount each winner/s won
For example:
Fruit 60.00 Anne, Bob, Clara 20.00
Remember, the program should not delete the current contents of the file. Instead, it should add the current game to the end of the file. .
Fourth: The players will then be asked if they want be play again:
If yes, the players will be asked to enter new bets (they will not need to re-enter their names) and the game will start with the players select the set of words.
If no, the computer will close the program .
Fifth: You will create a Java application that implements this card game. Save your program in the file WordGuessing Game.java. Your program must use at least three unique methods (though you are encouraged to use more) to implement the game. Each method must have a documentation (JavaDoc, /**) comment which describes how to use the method. Remember to use @param and @return when needed. Your program must include input validation for the user inputs (where required). Use descriptive variable and method names throughout your program, along with good programming style.

Trending now
This is a popular solution!
Step by step
Solved in 2 steps









