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

Function question6

Project_Quiz_Game/quiz-game.cpp:292–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290
291}
292void question6() {
293 cout << " ***********************************" << endl;
294 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;
295 cout << " ***********************************" << endl;
296 cout << "\t\t\t\t\t Q U E S T I O N No. 6" << endl;
297 cout << "Which is not a proper prototype?" << endl;
298 cout << "[1] int funct(char x, char y);" << endl;
299 cout << "[2] double funct(char x)" << endl;
300 cout << "[3] void funct();" << endl;
301 cout << "[4] char x();" << endl;
302 string answer;
303 cout << endl;
304 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
305 cin >> answer;
306 if (answer == "1" || answer == "2" || answer == "3" || answer == "4")
307 {
308 if (answer == "2")
309 {
310 total_score += 10;
311 correct_answer += 1;
312 cout << "C O R R E C T A N S W E R !!!" << endl;
313 cout << "You got 10 points out of 10." << endl;
314
315 }
316 else if (answer == "1" || answer == "3" || answer == "4")
317 {
318 cout << "W R O N G A N S W E R !!!" << endl;
319 cout << "You got 0 points out of 10." << endl;
320
321 }
322 cout << endl;
323 system("pause");
324 system("cls");
325 }
326 else
327 {
328 system("cls");
329 cout << "\t\t*************************************************************************************" << endl;
330 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;
331 cout << "\t\t*************************************************************************************" << endl;
332 cout << endl;
333 question6();
334 }
335}
336void question7() {
337 cout << " ***********************************" << endl;
338 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected