| 334 | } |
| 335 | } |
| 336 | void question7() { |
| 337 | cout << " ***********************************" << endl; |
| 338 | cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl; |
| 339 | cout << " ***********************************" << endl; |
| 340 | cout << "\t\t\t\t\t Q U E S T I O N No. 7" << endl; |
| 341 | cout << "Which of the following is a two-dimensional array?" << endl; |
| 342 | cout << "[1] array anarray[20][20];" << endl; |
| 343 | cout << "[2] int anarray[20][20];" << endl; |
| 344 | cout << "[3] int array[20, 20];" << endl; |
| 345 | cout << "[4] char array[20];" << endl; |
| 346 | string answer; |
| 347 | cout << endl; |
| 348 | cout << "\t\t\t\t\tENTER YOUR CHOICE: "; |
| 349 | cin >> answer; |
| 350 | if (answer == "1" || answer == "2" || answer == "3" || answer == "4") |
| 351 | { |
| 352 | if (answer == "2") { |
| 353 | total_score += 10; |
| 354 | correct_answer += 1; |
| 355 | cout << "C O R R E C T A N S W E R !!!" << endl; |
| 356 | cout << "You got 10 points out of 10." << endl; |
| 357 | } |
| 358 | else if (answer == "1" || answer == "3" || answer == "4") |
| 359 | { |
| 360 | cout << "W R O N G A N S W E R !!!" << endl; |
| 361 | cout << "You got 0 points out of 10." << endl; |
| 362 | |
| 363 | } |
| 364 | cout << endl; |
| 365 | system("pause"); |
| 366 | system("cls"); |
| 367 | } |
| 368 | else |
| 369 | { |
| 370 | system("cls"); |
| 371 | cout << "\t\t*************************************************************************************" << endl; |
| 372 | 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; |
| 373 | cout << "\t\t*************************************************************************************" << endl; |
| 374 | cout << endl; |
| 375 | question7(); |
| 376 | } |
| 377 | } |
| 378 | void question8() { |
| 379 | cout << " ***********************************" << endl; |
| 380 | cout << " ***** TOTAL SCORE:" << total_score << " *****" << endl; |