Question: Write a java program that plays a gambling game with 4 users Do not use arrays and continue, break statement. In the beginning, the four
Write a java program that plays a gambling game with 4 users
Do not use arrays and continue, break statement.
In the beginning, the four players would be asked to enter their names.
The users will then be asked to select one set of words they will all use for the game. The
options are:
Sports, foods, and colors (can use numbers to represent the data sets)
Each set of words must contain 5 options (can use numbers to represent the options).
For example. If the user chooses Sports the options will be basketball, baseball, etc.
The game would then repeat 5 times
Each of the users would enter a word from the set theyve chosen and the computer would randomly generate a word (generate a random number that represents the word) from that set and display it.
For instance, the computer had chosen basketball.
The user who got the correct answer would win one point.
The computer would then display the user with most points after 5 rounds of playing.
For instance, Will won 4 points, he is the winner.
Then, the program would record the result and write to a file named winner.txt.
For instance, Will won 4 points, he is the winner.
Finally, it would prompt the users to enter if they want to play again.
Each time the result would be appended to the existing winner.txt file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
