-
Notifications
You must be signed in to change notification settings - Fork 0
/
question.h
74 lines (61 loc) · 1.33 KB
/
question.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Cosimo Gonnelli
This is the header for the question base class and derived classes:
multiple choice and true false
*/
#ifndef QUESTION
#define QUESTION
#include<iostream>
#include<fstream>
#include<cstring>
#include<cctype>
#include<cstdlib>
using namespace std;
const int SIZE = 500;
//base class question for the pool of questions of the LLL in the BST
class question
{
public:
question();
virtual ~question();
void destroy();
question(char * c, char * q, int ty, int qN);
question(const question & toCopy);
int getNumber();
virtual void display() const;
//operator overloading
question & operator = (const question & toCopy);
protected:
char * categ;
char * qBody;
int type; //m.choice or t/f
int qNumber;
};
//multiple choice is a question
class mChoice: public question
{
public:
mChoice();
~mChoice();
void destroyM();
mChoice(char * c, char * q, int ty, int qN, char * a1, char * a2, char * a3, char * a4);
mChoice(const mChoice & toCopy);
void display() const;
protected:
char * answer1;
char * answer2;
char * answer3;
char * answer4;
};
//true flase is a question
class trueFalse: public question
{
public:
trueFalse();
trueFalse(char * c, char * q, int ty, int qN, bool a);
trueFalse(const trueFalse & toCopy);
void display() const;
protected:
bool answer;
};
#endif