Question: Problem: Write a C++ program that will output multiple choice trivia questions. Part I Design and implement a class called Question. The Question class contains
Problem: Write a C++ program that will output multiple choice trivia questions. Part I Design and implement a class called Question. The Question class contains the following information a stem (the text of the trivia question), an array of 4 multiple choice answers (the text of each possible answer) the letter of the correct answer (A, B, C, or D), called the key This class will be used to represent trivia questions in a trivia game. The following operations should be available for Question objects (use the supplied names!). Construct a Question with no values (use empty strings for stem and answers and X' for the key). Construct a Question given its 3 components. setStem: Set the stem question. getStem: Return the stem question. setAnswers: Set the 4 answers given an array. The answers will NOT include the letter (A, B, C, or D). getAnswer(i): Return the single answer at index i. setKey: Set the key letter getKey: Return the key letter display: Output the stem and answers (but not the key), each on a separate line Output the letter A. before the first answer, B. before the second answer, and so on (you can use char( A to compute the letter for the question at index i). Put a period after each letter! * * * Save the class declaration in Question.h and save the member function definitions in Question.cpp (do not inline the member function definitions)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
