Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions