Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: C++ Create two classes for the program: Player and Question. Declare and define each in their own .h and .cpp files. In your Source.cpp

Language: C++

Create two classes for the program: Player and Question.

Declare and define each in their own .h and .cpp files.

In your Source.cpp file, create a trivia game for multiple players. Create 10 Question objects. Each question should have 4 possible answers, with only one being correct. At the beginning of the game, ask the user how many players are playing. Create as many Player objects as are requested.

Do not tell the players which questions they got right or wrong until the end of the game.

Inside each Player object, create two vectors that contain pointers to Question objects. One vector contains pointers to the questions the player got right and one contains pointers to the questions the player got wrong.

Then, ask each player 5 of the 10 questions. i.e. ask player 1 the first question, then ask player 2 the first question, etc.

At the end of the game, print out which players got each question right. Allow the user to play again, asking 5 different questions this time. Re-use the same Player objects, but make sure to clear the necessary data.

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago