True false questions and Multiple choice questions in c++ using text files

So im trying to create a quiz using c++ that incorporates three different types of questions. These are the standard one answer question, true false questions and multiple choice questions.

Can anyone tell me how to create the true false and multiple choice questions?

One way that i came up with looks like this

Question A answer1 B answer2;
This needs way more description.
You could have a Question class, with a question string, answer string and a dynamically sized array (vector) of strings for the answers (choices).
The Question objects could determine their own type based on the size and contents of the answers collection, and use this to determine how to interact with the student (overloaded functions, switch statement, etc).
Or you could give Question some children, each one a specific question type with an overriden (virtual) function for interacting with the student.
Topic archived. No new replies allowed.