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

Function question2

Project_Quiz_Game/quiz-game.cpp:125–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 }
124}
125void question2() {
126 cout << " ***********************************" << endl;
127 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;
128 cout << " ***********************************" << endl;
129 cout << "\t\t\t\t\t Q U E S T I O N No. 2" << endl;
130 cout << "What is the only function all C++ programs must contain?" << endl;
131 cout << "[1] start()" << endl;
132 cout << "[2] system()" << endl;
133 cout << "[3] program()" << endl;
134 cout << "[4] main()" << endl;
135 string answer;
136 cout<<endl;
137 cout << "\t\t\t\t\tENTER YOUR CHOICE: ";
138 cin >> answer;
139 if (answer == "1" || answer == "2" || answer == "3" || answer == "4")
140 {
141 if (answer == "4")
142 {
143 total_score += 10;
144 correct_answer += 1;
145 cout << "C O R R E C T A N S W E R !!!" << endl;
146 cout << "You got 10 points out of 10." << endl;
147 }
148 else if (answer == "1" || answer == "2" || answer == "3")
149 {
150 cout << "W R O N G A N S W E R !!!" << endl;
151 cout << "You got 0 points out of 10." << endl;
152 }
153 cout << endl;
154 system("pause");
155 system("cls");
156 }
157 else
158 {
159 system("cls");
160 cout << "\t\t*************************************************************************************" << endl;
161 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;
162 cout << "\t\t*************************************************************************************" << endl;
163 cout << endl;
164 question2();
165 }
166
167}
168void question3() {
169 cout << " ***********************************" << endl;
170 cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected