Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me out please! Trivia Game Implement the Question class that will be the base for a Trivia Game. The interface for this

Can someone help me out please!

Trivia Game

Implement the Question class that will be the base for a Trivia Game. The interface for this class is provided in question.h . Implement all member functions in question.cpp. Please note that it is important that you do not change question.h .

Create a program (in main.cpp, which you will turn in) that implements the trivia game. The program should create an array of 10 Question objects, one for each trivia question. Make up your own trivia questions on the subject or subjects of your choice.

Your game should present the user with the 10 questions in a way that you like. How you will present the questions and in which order is up to you, but make sure to follow these requirements:

the interface is friendly, not cluttered, with clear directions (ask someone to play your game to see if it is easy to follow)

the user is informed whether the answer they enter is right or wrong. If wrong, let them know what the correct answer is.

Question.h is

//

// Question.h

// Trivia

//

#ifndef Question_h

#define Question_h

#include

using namespace std;

class Question {

private:

string question;

string answer1;

string answer2;

string answer3;

string answer4;

unsigned short int correctAnswer;

public:

Question(string question, string ans1, string ans2, string ans3, string ans4, unsigned short int correct);

void setQuestion(string question);

void setAnswer1(string ans);

void setAnswer2(string ans);

void setAnswer3(string ans);

void setAnswer4(string ans);

void setCorrect(unsigned short int correct);

string getQuestion();

string getAnswer1();

string getAnswer2();

string getAnswer3();

string getAnswer4();

unsigned short int getCorrectAnswer();

};

#endif /* Question_hpp */

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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

Prepare an ID card of the continent Antarctica?

Answered: 1 week ago

Question

What do you understand by Mendeleev's periodic table

Answered: 1 week ago

Question

3. Who would the members be?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago