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

Function question3

Project_Quiz_Game/quiz-game.cpp:168–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167}
168void question3() {
169 cout << " ***********************************" << endl;
170 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;
171 cout << " ***********************************" << endl;
172 cout << "\t\t\t\t\t Q U E S T I O N No. 3" << endl;
173 cout << "Which of the following is a correct comment?" << endl;
174 cout << "[1] / Comment /" << endl;
175 cout << "[2] ** Comment **" << endl;
176 cout << "[3] { Comment }" << endl;
177 cout << "[4] //comment" << endl;
178 string answer;
179 cout << endl;
180 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
181 cin >> answer;
182 if (answer == "1" || answer == "2" || answer == "3" || answer == "4")
183 {
184 if (answer == "4") {
185 total_score += 10;
186 correct_answer += 1;
187 cout << "C O R R E C T A N S W E R !!!" << endl;
188 cout << "You got 10 points out of 10." << endl;
189 }
190 else if (answer == "1" || answer == "2" || answer == "3")
191 {
192 cout << "W R O N G A N S W E R !!!" << endl;
193 cout << "You got 0 points out of 10." << endl;
194 }
195 cout << endl;
196 system("pause");
197 system("cls");
198 }
199 else
200 {
201 system("cls");
202 cout << "\t\t*************************************************************************************" << endl;
203 cout << "\t\t**** P L E A S E I N P U T C O R R E C T V A L U E ! ****" << endl;
204 cout << "\t\t*************************************************************************************" << endl;
205 cout << endl;
206 question3();
207 }
208}
209void question4() {
210 cout << " ***********************************" << endl;
211 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected