// Created By: Mr. Jake Rodriguez Pomperada,MAED-IT
// Date : January 14, 2010 Thursday
// Email : jakerpomperada@yahoo.com
// Tool : C++
#include <iostream>
#include <string.h>
using namespace std;
main() {
char ot[20],jap[20],ma[20],ro[20],mo[20],capital[20];
int wrong=0,right=0;
string remarks;
float solve=0;
cout << "\n\t\t == CAPITAL CITY QUIZ GAMES IN C++ ==";
cout << "\n";
cout << " \n\t\tCreated By: Mr. Jake R. Pomperada, MAED-IT";
cout << "\n\n";
cout << "What is Capital City of Canada ? : ";
gets(capital);
strupr(capital); // Function To Conver Lower Case To UpperCase
strcpy(ot,"OTTAWA");
if (strcmp(ot,capital) == 0) {
cout << "\n Your answer "
<< capital << " is right.";
cout << "\n The Capital City of Canada is Ottawa.";
right++;
}
else {
cout << "\n Your answer "
<< capital << " is wrong.";
cout << "\n The Capital City of Canada is Ottawa.";
wrong++;
}
cout << "\n\n";
cout << "What is Capital City of Japan ? : ";
gets(capital);
strupr(capital); // Function To Conver Lower Case To UpperCase
strcpy(jap,"TOKYO");
if (strcmp(jap,capital) == 0) {
cout << "\n Your answer "
<< capital << " is right.";
cout << "\n The Capital City of Japan is Tokyo.";
right++;
}
else {
cout << "\n Your answer "
<< capital << " is wrong.";
cout << "\n The Capital City of Japan is Tokyo.";
wrong++;
}
cout << "\n\n";
cout << "What is Capital City of Philippines ? : ";
gets(capital);
strupr(capital); // Function To Conver Lower Case To UpperCase
strcpy(ma,"MANILA");
if (strcmp(ma,capital) == 0) {
cout << "\n Your answer "
<< capital << " is right.";
cout << "\n The Capital City of Philippines is Manila";
right++;
}
else {
cout << "\n Your answer "
<< capital << " is wrong.";
cout << "\n The Capital City of Philippines is Manila.";
wrong++;
}
cout << "\n\n";
cout << "What is Capital City of Italy ? : ";
gets(capital);
strupr(capital); // Function To Conver Lower Case To UpperCase
strcpy(ro,"ROME");
if (strcmp(ro,capital) == 0) {
cout << "\n Your answer "
<< capital << " is right.";
cout << "\n The Capital City of Italy is Rome.";
right++;
}
else {
cout << "\n Your answer "
<< capital << " is wrong.";
cout << "\n The Capital City of Italy is Rome.";
wrong++;
}
cout << "\n\n";
cout << "What is Capital City of Russia ? : ";
gets(capital);
strupr(capital); // Function To Conver Lower Case To UpperCase
strcpy(mo,"MOSCOW");
if (strcmp(mo,capital) == 0) {
cout << "\n Your answer "
<< capital << " is right.";
cout << "\n The Capital City of Russia is Moscow.";
right++;
}
else {
cout << "\n Your answer "
<< capital << " is wrong.";
cout << "\n The Capital City of Russia is Moscow.";
wrong++;
}
solve = (right / 5.0) * 50 + 50;
if (solve >= 75) {
remarks = "You Passed the Quiz Congrats !!!";
}
else {
remarks = "Sorry you Failed the Quiz Try Again!!!";
}
cout << "\n\n\n";
cout << " === SUMMARY RESULTS ====";
cout << "\n";
cout << "\n Number of Right Answers :=> "
<< right << ".";
cout << "\n Number of Wrong Answers :=> "
<< wrong << ".";
cout << "\n\n";
cout << " Your Grade : " << solve;
cout << "\n Remarks : " << remarks;
cout << "\n\n";
system("PAUSE");
}