Está en la página 1de 14

#include<iostream.

h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>
#include<dos.h>
float random1();
float random2();
float random3();
float random4();

main(){
char ans;
clrscr();
int randomnum;
srand(time(0));
randomnum=(rand()%4+1);
cout<<"Random Question Generator"<<endl;
if(randomnum==1){
random1();
}
else if(randomnum==2){
random2();
}
else if(randomnum==3){
random3();
}
else if(randomnum==4){
random4();
}

getch();

}
float random1(){
int game=0;
int life=2;
char ch;
while(game!=1){
cout<<"life: "<<life<<endl;
cout<<"[1] In 1851, the first commercial bank in the Phillipines and the far East,
was established. What is the present name of this bank?"<<endl;
cout<<"a.) Bank of the Philippine Islands\nb.) Bangko De Oro\nc.) Allied
bank\nd.)Land Bank of the Philippines\nAnswer: ";
cin>>ch;
if(ch!='a'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"correct"<<endl;
}
cout<<"\nlife: "<<life<<endl;
cout<<"[2] Who is the father of modern computers? "<<endl;
cout<<"a.) Abrahan Lincoln "<<endl;
cout<<"b.) Charles Babbage"<<endl;
cout<<"c.) James Bond"<<endl;
cout<<"d.) Jaypee Castro\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else cout<<"correct"<<endl;
cout<<"\nlife: "<<life<<endl;
cout<<"[3] _____ are software which is used to do particular task. "<<endl;
cout<<"a.) Operating System "<<endl;
cout<<"b.) Program"<<endl;
cout<<"c.) Data"<<endl;
cout<<"d.) Software\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[4] The term 'Pentium' is related to? "<<endl;
cout<<"a.) DVD "<<endl;
cout<<"b.) Hard Disk"<<endl;
cout<<"c.) Microprocessor"<<endl;
cout<<"d.) Mouse\nAnswer: ";
cin>>ch;
if(ch!='c'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[5] Longest River on Earth? "<<endl;
cout<<"a.) Nile "<<endl;
cout<<"b.) Delaware"<<endl;
cout<<"c.) yamuna"<<endl;
cout<<"d.) Ganges\nAnswer: ";
cin>>ch;
if(ch!='a'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[6] Which is the World's largest desert? "<<endl;
cout<<"a.) gobi "<<endl;
cout<<"b.) thar"<<endl;
cout<<"c.) mojave"<<endl;
cout<<"d.) Sahara\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[7] If a religion is polytheistic,it has: "<<endl;
cout<<"a.) Altar "<<endl;
cout<<"b.) Multiple Gods"<<endl;
cout<<"c.) Angels"<<endl;
cout<<"d.) Martyrs\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[8] 20% of 2 is equal to? "<<endl;
cout<<"a.) 0.2 "<<endl;
cout<<"b.) 0.4"<<endl;
cout<<"c.) 0.04"<<endl;
cout<<"d.) 0.02\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

cout<<"CONGRATULATIONS YOU WIN"<<endl;


cout<<"Press Enter";
getch();
game++;
}
else{
cout<<"CONGRATULATIONS YOU WIN"<<endl;
cout<<"Press Enter";
getch();
game++;
}
clrscr();

}//end of while loop


end:
}//end of funcion
float random2(){
int game=0;
int life=2;
char ch;
while(game!=1){
cout<<"life: "<<life<<endl;
cout<<"[1]Considered as the first Philippine hero."<<endl;
cout<<"a.) Ferdinand Magellan\nb.) Lapu-Lapu\nc.) King Philip of Spain\nd.) Jose
Rizal\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"correct"<<endl;
}
cout<<"\nlife: "<<life<<endl;
cout<<"[2]Which is the world's most populous country "<<endl;
cout<<"a.) America "<<endl;
cout<<"b.) China"<<endl;
cout<<"c.) India"<<endl;
cout<<"d.) Spain\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else cout<<"correct"<<endl;
cout<<"\nlife: "<<life<<endl;
cout<<"[3]What invention caused many deaths while testing it?"<<endl;
cout<<"a.)Dynamite\nb.)Ladders\nc.)Race cars\nd.)Parachute\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[4]For which of the following disciplines is Nobel Prize awarded?"<<endl;

cout<<"a.)Physics and Chemistry\nb.)Physiology or Medicine\nc.)Literature, Peace


and Economics\nd.)All of the above\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[5] .MOV' extension refers usually to what kind of file?"<<endl;
cout<<"a.)Image file\nb.)Animation/movie file\nc.)Audio file\nd.)MS Office
document\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[6] 'OS' computer abbreviation usually means ?"<<endl;

cout<<"a.)Order of Significance\nb.)Open Software\nc.)Operating System\nd.)Optical


Sensor\nAnswer: ";
cin>>ch;
if(ch!='c'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[7] Which of the following is used in pencils?"<<endl;

cout<<"a.)Graphite\nb.)Silicon\nc.)Charcoal\nd).Phosphorous\nAnswer: ";
cin>>ch;
if(ch!='a'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[8] Galileo was an Italian astronomer who."<<endl;

cout<<"a).developed the telescope\nb.)discovered four satellites of


Jupiter\nc.)discovered that the movement of pendulum produces a regular time
measurement\nd.)All of the above\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

cout<<"CONGRATULATIONS YOU WIN"<<endl;


cout<<"Press Enter";
getch();
game++;
}
else{
cout<<"CONGRATULATIONS YOU WIN"<<endl;
cout<<"Press Enter";
getch();
game++;
}
clrscr();

}//end of while loop


end:

}
float random3(){
int game=0;
int life=2;
char ch;
while(game!=1){
cout<<"life: "<<life<<endl;
cout<<"[1] Which nutrient is primarily needed to build parts of your body like skin
and muscled?"<<endl;
cout<<"a.) Vitamins\nb.) Water\nc.) fiber\nd.) Proteins\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"correct"<<endl;
}
cout<<"\nlife: "<<life<<endl;
cout<<"[2] Who founded the La Liga Filipina? "<<endl;
cout<<"a.) Apolinario Mabini"<<endl;
cout<<"b.) Jose Rizal"<<endl;
cout<<"c.) Andress Bonifacio"<<endl;
cout<<"d.) Fidel Ramos"<<endl<<"Answer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else cout<<"correct"<<endl;
cout<<"\nlife: "<<life<<endl;
cout<<"[3] An atom's atomic number is determined by the number of: "<<endl;
cout<<"a.) neutrons minus protons "<<endl;
cout<<"b.) protons"<<endl;
cout<<"c.) electrons"<<endl;
cout<<"d.) neutrons\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[4] Which part of an atom has no electrical charge "<<endl;
cout<<"a.) Electron "<<endl;
cout<<"b.) Neutron"<<endl;
cout<<"c.) Proton"<<endl;
cout<<"d.) All of the above\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[5] '.MPG' extension refers usually to what kind of file? "<<endl;
cout<<"a.) WordPerfect Document file "<<endl;
cout<<"b.) MS Office document"<<endl;
cout<<"c.) Image file"<<endl;
cout<<"d.) Animation/movie file\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[6] An example of potential energy is "<<endl;
cout<<"a.) tea-kettle steam "<<endl;
cout<<"b.) a moving vehicle"<<endl;
cout<<"c.) the sun"<<endl;
cout<<"d.) a battery\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[7] Current is considered as the movement of: "<<endl;
cout<<"a.) electrons "<<endl;
cout<<"b.) protons"<<endl;
cout<<"c.) charge"<<endl;
cout<<"d.) nuclei\nAnswer: ";
cin>>ch;
if(ch!='a'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[8] The first microprocessor had a(n)________. "<<endl;
cout<<"a.) 1-bit data bus "<<endl;
cout<<"b.) 2-bit data bus"<<endl;
cout<<"c.) 4-bit data bus"<<endl;
cout<<"d.) 8-bit data bus\nAnswer: ";
cin>>ch;
if(ch!='c'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

cout<<"CONGRATULATIONS YOU WIN"<<endl;


cout<<"Press Enter";
getch();
game++;
}
else{
cout<<"CONGRATULATIONS YOU WIN"<<endl;
cout<<"Press Enter";
getch();
game++;
}
clrscr();

}//end of while loop


end:

}
float random4(){
int game=0;
int life=2;
char ch;
while(game!=1){
cout<<"life: "<<life<<endl;
cout<<"[1] The first and youngest president of first Philippine Republic?"<<endl;
cout<<"a.) Manule Roxas\nb.) Manuel L. Quezon \nc.) Emilio Aguinaldo\nd.) none of
the above\nAnswer: ";
cin>>ch;
if(ch!='c'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"correct"<<endl;
}
cout<<"\nlife: "<<life<<endl;
cout<<"[2] The Koran is the holy book of which religion? "<<endl;
cout<<"a.) Christianity "<<endl;
cout<<"b.) Hinduism"<<endl;
cout<<"c.) Judaism"<<endl;
cout<<"d.) islam\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
}
}
else{ cout<<"correct"<<endl;
}
cout<<"\nlife: "<<life<<endl;
cout<<"[3] The brain of any computer system is "<<endl;
cout<<"a.) ALU "<<endl;
cout<<"b.) Memory"<<endl;
cout<<"c.) CPU"<<endl;
cout<<"d.) Control unit\nAnswer: ";
cin>>ch;
if(ch!='c'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[4] The largest country of the world by geographical area is "<<endl;
cout<<"a.) Russia "<<endl;
cout<<"b.) Vatican City"<<endl;
cout<<"c.) Australia"<<endl;
cout<<"d.) USA\nAnswer: ";
cin>>ch;
if(ch!='a'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[5] 16th President of the philippines "<<endl;
cout<<"a.) Rodrigo Duterte "<<endl;
cout<<"b.) mikel castro"<<endl;
cout<<"c.) jaypee blacer yamuna"<<endl;
cout<<"d.) robert enriquez Ganges\nAnswer: ";
cin>>ch;
if(ch!='a'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[6] Which is the World's largest desert? "<<endl;
cout<<"a.) gobi "<<endl;
cout<<"b.) thar"<<endl;
cout<<"c.) mojave"<<endl;
cout<<"d.) Sahara\nAnswer: ";
cin>>ch;
if(ch!='d'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[7] If a religion is polytheistic,it has: "<<endl;
cout<<"a.) Altar "<<endl;
cout<<"b.) Multiple Gods"<<endl;
cout<<"c.) Angels"<<endl;
cout<<"d.) Martyrs\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}
}
else{
cout<<"Correct"<<endl;
}
cout<<"\nLife: "<<life<<endl;
cout<<"[8] 20% of 2 is equal to? "<<endl;
cout<<"a.) 0.2 "<<endl;
cout<<"b.) 0.4"<<endl;
cout<<"c.) 0.04"<<endl;
cout<<"d.) 0.02\nAnswer: ";
cin>>ch;
if(ch!='b'){
cout<<"Wrong"<<endl;
life--;
if(life==0){
game++;
cout<<"Game Over"<<endl;
cout<<"Press Enter"<<endl;
getch();
clrscr();
goto end;
}

cout<<"CONGRATULATIONS YOU WIN"<<endl;


cout<<"Press Enter";
getch();
game++;
}
else{
cout<<"CONGRATULATIONS YOU WIN"<<endl;
cout<<"Press Enter";
getch();
game++;
}
clrscr();

}//end of while loop


end:

También podría gustarte