Question: 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
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 user’s score.
Step by Step Solution
3.41 Rating (167 Votes )
There are 3 Steps involved in it
ANSWER import javautilScanner public class Trivia data members private String question private Strin... View full answer
Get step-by-step solutions from verified subject matter experts
