Create a C++ program to run a simple multiple choice quiz on C++. The quiz should have questions such as this:
How do you declare a variable x to be a pointer to a constant integer?
1) int * const x
2) int const * const x
3) int const *x
4) int *x
Select answer (1-4) :>
The program should have two classes called Question and Quiz.
The Question class should hold all the data and methods for a single question with four different possible answers.
It should include fields to hold:
1) The question;
2) The possible answers;
3) The marks for each answer;
4) A comment to give to a user for each choice of answer;
5) The answer selected by the user.
It should have methods to:
1) Display the question;
2) Obtain an answer from the user;
3) Return the userís score;
4) Display the comments.
The Quiz class should hold an array of up to 20 questions. It should have methods to:
1) Present the questions in order;
2) Display the total score;
3) Take the user through their answers showing the correct answer and the comment.
Both classes may have other fields, methods or constructors as appropriate.
You should have a main method that sets up a quiz with 4 questions, runs the quiz and displays the scores and comments.
I have no idea how to create these classes!please help!!
//COM316 Coursework 2 2011
class Question //question class
void setQuestion(string q);
int (string); //declare method
class Quiz //quiz class
void Question::setQuestion(string q)
cout<< question << endl;
cout<<"Question" << i+1 << endl;
int Quiz::Question(string s) //question method
//holds information for questions
string Quiz::questions(string s) //quiz method
//array of questions
int main () //main method
q.questions.setQuestion("What colour is");