MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / askQuestion

Method askQuestion

Project_Quiz_Game/quiz-game-with-oop.cpp:157–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void Question::askQuestion() {
158 cout << endl;
159 cout << Question_Text << endl;
160 cout << "1. " << Answer_1 << endl;
161 cout << "2. " << Answer_2 << endl;
162 cout << "3. " << Answer_3 << endl;
163 cout << "4. " << Answer_4 << endl;
164 cout << endl;
165
166
167 cout << "Answer: ";
168 cin >> Guess;
169
170 if (Guess == Correct_Answer)
171 {
172 cout << endl;
173 cout << "Great! You are Correct." << endl;
174 Total += Question_Score;
175 cout << "Score: " << Question_Score << " Out of " << Question_Score << " !" << endl;
176
177 }
178 else
179 {
180 cout << endl;
181 cout << "Oh, NO. You are Wrong." << endl;
182 cout<<"Score: 0"<<" Out of "<<Question_Score<< " !" << endl;
183 cout << "The correct answer is " << Correct_Answer << endl;
184 cout<<endl;
185 }
186}
187
188
189

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected