-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
148 lines (108 loc) · 3.22 KB
/
Copy pathmain.cpp
File metadata and controls
148 lines (108 loc) · 3.22 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#include <iostream>
#include <list>
#include <string>
// #include "Variable.h"
using namespace std;
/*
Variable List
1. Gender
2. chestPain
backPain
abPain
sidePain
breastPain
pelvicPain
testiPain
coughBlood
urineBlood
rectalBlood
weightLoss
erectDys
freqUrine
breastLump
(if VariableList[1].isInstatiated() == false)
then ask the question, store value in
VariableList[1].value()
if (VariableList[1].Value() == yes
(if VariableList[2].isInstatiated() == false)
then ask the question, store value in VariableList[2].Value()
Conclusion List
cancer
Knowledge Base
10:
contains some list containing: *VariableList[1], *VariableList[2]
*/
class Variable{
public:
// Variable();
// ~Variable();
void setQuestion(std::string questionsstring){
this->question = questionsstring;
}
std::string getQuestion(){
return this->question;
}
bool getInstantiated(){
return this->isInstantiated;
}
void Instantiate(bool userAnswer){
this->isInstantiated = true;
this->answer = userAnswer;
}
private:
std::string variablename;
bool isInstantiated = false;
bool answer = false;
std::string question;
};
int main(){
std::list<Variable> VariableList;
Variable Gender;
Gender.setQuestion("Is the patient female?");
VariableList.push_back(Gender);
Variable chestPain;
chestPain.setQuestion("Is the patient experiencing chest pain?");
VariableList.push_back(chestPain);
Variable backPain;
backPain.setQuestion("Ist the patient experiencing back pain?");
VariableList.push_back(Gender);
Variable abPain;
abPain.setQuestion("Is the patient experiencing abdomenal pain?");
VariableList.push_back(abPain);
Variable sidePain;
sidePain.setQuestion("Is the patient experiencing pain in their side?");
VariableList.push_back(sidePain);
Variable testiPain;
testiPain.setQuestion("Is the patient experiencing pain in their testicles?");
VariableList.push_back(testiPain);
Variable pelvicPain;
pelvicPain.setQuestion("Is the patient experiencing pelvic pain?");
VariableList.push_back(pelvicPain);
Variable coughBlood;
coughBlood.setQuestion("Is the patient coughing up blood?");
VariableList.push_back(coughBlood);
Variable urineBlood;
urineBlood.setQuestion("Is the patient urinating blood?");
VariableList.push_back(urineBlood);
Variable rectalBlood;
rectalBlood.setQuestion("Is the patient experiencing rectile bleeding?");
VariableList.push_back(Gender);
Variable weightLoss;
weightLoss.setQuestion("Is the patient experiencing unexpected weight loss?");
VariableList.push_back(Gender);
Variable erectDys;
erectDys.setQuestion("Is the patient experiencing erectile dysfuction?");
VariableList.push_back(erectDys);
Variable freqUrine;
freqUrine.setQuestion("Is the patient experiencing frequent urination?");
VariableList.push_back(freqUrine);
Variable breastLump;
breastLump.setQuestion("Does the patient have a breast lump?");
VariableList.push_back(breastLump);
std::list<Variable>::iterator it;
for (it = VariableList.begin(); it!= VariableList.end(); ++it) {
std::cout << it->getQuestion();
std::cout << std::endl;
}
return 0;
}