Question: Java Programming You are to create a trivia game. Your application should consist of 3 players. The initial screen should look something like this: Welcome
Java Programming
You are to create a trivia game. Your application should consist of 3 players. The initial screen should look something like this:
Welcome to the Trivia Game Show!
Scores so far:
Player 1: 0 Player 2: 0 Player 3: 0
______________________________________
Player 1 Here is your question:
Water is made of the elements hydrogen and what?
Type in your answer: _
The questions for the game should be kept in a string array, and the answers to the questions should be kept in a parallel string array. You should have at least 20 questions and 20 answers in these arrays. You can make up any 20 questions. To see which question is asked, create a random number from 0-19. Each number represents the question in the array. Make sure when playing the game, a question is never repeated.
So, if Player 1 answers correctly, add 50 points to their score, and present the same player (Player 1) with another question. Here is an example when player 1 answers correctly:
Welcome to the Trivia Game Show!
Scores so far:
Player 1: 0 Player 2: 0 Player 3: 0
_______________________________________
Player 1 Here is your question:
Water is made of the element hydrogen and what?
Type in your answer: oxygen
Correct! You now have 50 points! Here is your next question:
Create another random number that corresponds to another question in the array (but remember not to repeat any questions).
Welcome to the Trivia Game Show!
Scores so far:
Player 1: 50 Player 2: 0 Player 3: 0
_______________________________________
Player 1 - Here is your question:
What is the mascot of the NFL football team in Pittsburgh? _
If Player 1 gives an incorrect answer, display the word incorrect, display the correct answer, display the scores, and now ask the next player (Player 2) a question. Your screen should now look something like this:
Welcome to the Trivia Game Show!
Scores so far:
Player 1: 50 Player 2: 0 Player 3: 0
_______________________________________
Player 1 - Here is your question:
What is the mascot of the NFL football team in Pittsburgh? patriots
Incorrect. This correct answer is Steelers.
Scores so far:
Player 1: 50 Player 2: 0 Player 3: 0
Player 2 Here is your question:
What company is known for the iPad? _
The game continues this way for 3 players until someone reaches 200 points. When a player reaches 200 points. Display Congratulations and end the game.
When the game ends, create an output file (include exception handling) called results.txt that contains number of correct answers and incorrect answers for each player. For example:
Player 1: 4 correct, 1 incorrect
Player 2: 1 correct, 2 incorrect
Player 3: 2 correct, 1 incorrect
Along with the Main method, you should also have at least 2 other methods:
*Method for generating a random number and returns that number which corresponds to the index (question in the string array).
*Method that keeps track of player points; player points should be an integer array of 3 elements.
** Create more methods if youd like. For example, method for drawing the game board, etc.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
