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

Function question8

Project_Quiz_Game/quiz-game.cpp:378–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376 }
377}
378void question8() {
379 cout << " ***********************************" << endl;
380 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;
381 cout << " ***********************************" << endl;
382 hints();
383 cout << "\t\t\t\t\t Q U E S T I O N No. 8" << endl;
384 cout << "Evaluate !(1 && !(0 || 1))." << endl;
385 cout << "[1] True" << endl;
386 cout << "[2] False" << endl;
387 cout << "[3] Unevaluatable" << endl;
388 string answer;
389 cout << endl;
390 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
391 cin >> answer;
392 //limiting the answers of the user
393 if (answer == "1" || answer == "2" || answer == "3" )
394 {
395 if (answer == "1") {
396 total_score += 10;
397 correct_answer += 1;
398 cout << "C O R R E C T A N S W E R !!!" << endl;
399 cout << "You got 10 points out of 10." << endl;
400
401 }
402 else if (answer == "2" || answer == "3")
403 {
404 cout << "W R O N G A N S W E R !!!" << endl;
405 cout << "You got 0 points out of 10." << endl;
406
407 }
408 cout << endl;
409 system("pause");
410 system("cls");
411 }
412 //if cases for the hints
413 else if (answer == "A" || answer == "a")
414 {
415 hints_used++;
416 cout << endl;
417 cout << "Audience prediction is... " << endl;
418 cout << "[1] 42%" << endl;
419 cout << "[2] 38%" << endl;
420 cout << "[3] 20%" << endl;
421 cout << endl;
422 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
423 cin >> answer;
424 if (answer == "1") {
425 total_score += 5;
426 correct_answer += 1;
427 cout << "C O R R E C T A N S W E R !!!" << endl;
428 cout << "You got 10 points out of 5." << endl;
429
430 }
431 else if (answer == "2" || answer == "3")
432 {
433 cout << "W R O N G A N S W E R !!!" << endl;
434 cout << "You got 0 points out of 5." << endl;
435

Callers 1

mainFunction · 0.85

Calls 1

hintsFunction · 0.85

Tested by

no test coverage detected