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

Function question10

Project_Quiz_Game/quiz-game.cpp:718–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716 }
717}
718void question10() {
719 cout << " ***********************************" << endl;
720 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;
721 cout << " ***********************************" << endl;
722 hints();
723 cout << "\t\t\t\t\t Q U E S T I O N No. 10" << endl;
724 cout << "What will i and j equal after the code below is executed?" << endl;
725 cout << "int i = 5;" << endl;
726 cout << "int j = i++;" << endl;
727 cout << "[1] i=5, j=5 " << endl;
728 cout << "[2] i=5, j=4" << endl;
729 cout << "[3] i=5, j=6" << endl;
730 cout << "[4] ERROR" << endl;
731 string answer;
732 cout << endl;
733 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
734 cin >> answer;
735 if (answer == "1" || answer == "2" || answer == "3" || answer == "4")
736 {
737 if (answer == "3") {
738 total_score += 10;
739 correct_answer += 1;
740 cout << "C O R R E C T A N S W E R !!!" << endl;
741 cout << "You got 10 points out of 10." << endl;
742 }
743 else if (answer == "1" || answer == "2" || answer == "4")
744 {
745 cout << "W R O N G A N S W E R !!!" << endl;
746 cout << "You got 0 points out of 10." << endl;
747 }
748 cout << endl;
749 system("pause");
750 system("cls");
751 }
752 else if (answer == "A" || answer == "a")
753 {
754 hints_used++;
755 cout << endl;
756 cout << "Audience prediction is... " << endl;
757 cout << "[1] 30%" << endl;
758 cout << "[2] 25%" << endl;
759 cout << "[3] 20%" << endl;
760 cout << "[4] 25%" << endl;
761 cout << endl;
762 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
763 cin >> answer;
764 if (answer == "3") {
765 total_score += 5;
766 correct_answer += 1;
767 cout << "C O R R E C T A N S W E R !!!" << endl;
768 cout << "You got 5 points out of 5." << endl;
769 }
770 else if (answer == "1" || answer == "2" || answer == "4")
771 {
772 cout << "W R O N G A N S W E R !!!" << endl;
773 cout << "You got 0 points out of 5." << endl;
774
775 }

Callers 1

mainFunction · 0.85

Calls 1

hintsFunction · 0.85

Tested by

no test coverage detected