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 together 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.
One game would contain 5 rounds of playing
Each round the users would enter a word from the set theyve all chosen together and the computer would randomly generate a word (generate a random number that represents the word) from that set and display it.
For instance, user 1 choose basketball from the sports data set
User 2 choose baseball from the sports data set
Finally, the computer had chosen basketball.
The user who got the correct answer would win one point.
The computer would then display the user with the most points after 5 rounds of play.
For instance, Frank 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 asl the user to enter yes(y) 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
