Question: Use JAVA: Read the description of project # 14 on page 582 of Chapter 7. Follow the specs below. 14 Practice Program 5.4 asked you
Use JAVA:
Read the description of project # 14 on page 582 of Chapter 7. Follow the specs below.
14 Practice Program 5.4 asked you to define a Trivia class that contained strings representing a trivia question and answer to that question. Add an integer for the number of points that the question is worth if the player gets the question right. create constructor, accessor and mutator methods. Use this class in a program that creates an array of 10 Trivia objects. You can select questions, answers, and point values of your choice. Make a loop that asks each trivia question to the player, input an answer, output whether the
answer is correct or incorrect (if incorrect also output the correct answer), and after all questions have been asked output the users score.
1. Read the input file below to construct TriviaGame, TriviaQuestion, and Driver classes.
2. In the Driver class, make a loop to ask each question to the player and keep scores.
3. You must use a two-dimensional array to keep game scores.
4. At the end of the game, output the game score for each category and the overall score. 5. Follow the class discussions to complete the HW.
The format of the input file is below.
5 -- # of questions
2 -- # of categories
Math -- category What is 3 + 4? -- the question 2 -- points worth 3 -- # of acceptable answers 7 seven Seven Computer Science -- category
What is the prerequisite of CSC 201? -- question 3 -- points worth
4 -- # of answers
CSC 200
MATH 174
CSC200
MATH174 Math What is 8 + 7? 1 3 15 Fifteen fifteen Computer Science -- category How many hours should you spend per week on a 4-credit course such as CSC 201? 3 4 at least 8 hours at least 9 hours at least 10 hours 12 hours Math What is 1 divided by 0? 1 3 no answer not a number silly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
