Here is the initial question. Write a program that plays a simple trivia game. T
ID: 3540695 • Letter: H
Question
Here is the initial question.
Write a program that plays a simple trivia game. The game should have five ques- tions. Each question has a corresponding answer and point value between 1 and 3 based on the difficulty of the question. Implement the game using three arrays. An array of type String should be used for the questions. Another array of type String should be used to store the answers. An array of type int should be used for the point values. All three arrays should be declared to be of size 5.
The index into the three arrays can be used to tie the question, answer, and point value together. For example, the item at index 0 for each array would correspond to question 1, answer 1, and the point value for question 1. The item at index 1 for each array would correspond to question 2, answer 2, and the point value for question 2, and so forth. Manually hardcode the five questions, answers, and point values into your program using trivia of your choice.
Your program should ask the player each question one at a time and allow the player to enter an answer. If the player%u2019s answer matches the actual answer, the player wins the number of points for that question. If the player%u2019s answer is incor- rect, the player wins no points for the question. Your program should show the correct answer if the player is incorrect. After the player has answered all five ques- tions, the game is over, and your program should display the player%u2019s total score.
Here is the question I want completed
ModifyProgrammingProject6.12touseasinglearrayinsteadofthreearrays.This can be accomplished by creating a Trivia object that encapsulates the question, answer, and point value for a particular trivia question. Next, create a single array of five Trivia objects instead of three separate arrays for the question, answer, and point values. This change will make your game more scalable if there were ever additional properties to add to a Trivia object (you would not need to add another array for each property). Although the program has internally changed to a single array of objects, the execution of the program should be identical to before.
Explanation / Answer
initQuestions(questions); //undefind
showGameResults(players);// insert"{" to complete body
public static initQuestions(Question qArray[]) throws IOException {// return type for the method missing