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

Function question5

Project_Quiz_Game/quiz-game.cpp:250–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248 }
249}
250void question5() {
251 cout << " ***********************************" << endl;
252 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;
253 cout << " ***********************************" << endl;
254 cout << "\t\t\t\t\t Q U E S T I O N No. 5" << endl;
255 cout << "Which of the following is a complete function?" << endl;
256 cout << "[1] int funct();" << endl;
257 cout << "[2] int funct(int x) {return x=x+1;}" << endl;
258 cout << "[3] void funct(int) {cout<<'Hello'}" << endl;
259 cout << "[4] void funct(x) {cout<<'Hello'}" << endl;
260 string answer;
261 cout << endl;
262 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
263 cin >> answer;
264 if (answer == "1" || answer == "2" || answer == "3" || answer == "4")
265 {
266 if (answer == "2") {
267 total_score += 10;
268 correct_answer += 1;
269 cout << "C O R R E C T A N S W E R !!!" << endl;
270 cout << "You got 10 points out of 10." << endl;
271 }
272 else if (answer == "1" || answer == "3" || answer == "4")
273 {
274 cout << "W R O N G A N S W E R !!!" << endl;
275 cout << "You got 0 points out of 10." << endl;
276 }
277 cout << endl;
278 system("pause");
279 system("cls");
280 }
281 else
282 {
283 system("cls");
284 cout << "\t\t*************************************************************************************" << endl;
285 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;
286 cout << "\t\t*************************************************************************************" << endl;
287 cout << endl;
288 question5();
289 }
290
291}
292void question6() {
293 cout << " ***********************************" << endl;
294 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected