#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;
void main()
{
FILE *group7a;
FILE *group7b;
FILE *group7c;
char aaa[40];
char bbb[40];
char ccc[40];
char user[10];
char pass[10];
int file1=1;
int file2=2;
int file3=3;
int easyx=0;
int easyy=0;
int avex=0;
int avey=0;
int hardx=0;
int hardy=0;
int hamp;
char hatch;
char z1=0;
char z2=0;
char z3=0;
char z4=0;
char z5=0;
char z6=0;
char z7=0;
char z8=0;
char z9=0;
char z10=0;
char y1=0;
char y2=0;
char y3=0;
char y4=0;
char y5=0;
char y6=0;
char y7=0;
char y8=0;
char y9=0;
char y10=0;
char x1=0;
char x2=0;
char x3=0;
char x4=0;
char x5=0;
char x6=0;
char x7=0;
char x8=0;
char x9=0;
char x10=0;
hatch='n';
while(hatch!='y')
{
cout<<"Input username to continue:"<<endl;
cin>>user;
cout<<"Input password:"<<endl;
cin>>pass;
if((strcmp(user,"lasalle")==0)&&(strcmp(pass,"group7")==0))
{
cout<<"\nCORRECT USERNAME AND PASSWORD!\n"<<endl;
void password();
}else{
cout<<"\nWRONG USERNAME AND PASSWORD. ACCESS IS DENIED\n"<<endl;
exit(0);
}
void password();
cout<<"SCIENCE IS FUN GAME"<<endl;
cout<<"Main Menu"<<endl;
cout<<"1 - Game Description"<<endl;
cout<<"2 - Game Programmers"<<endl;
cout<<"3 - EASY ROUND"<<endl;
cout<<"4 - AVERAGE ROUND"<<endl;
cout<<"5 - DIFFICULT ROUND"<<endl;
cout<<"6 - Exit"<<endl;
cout<<"Choose "<<endl;
cin>>hamp;
switch(hamp)
{
case 1:
{
cout<<"PROGRAM DESCRIPTION: "<<endl;
cout<<"\n\n\n\n\n\n\n\n"<<endl;
cout<<"IT "<<endl;
cout<<"Presented for "<<endl;
cout<<"The Partial Fullfillment"<<endl;
cout<<"In the course of"<<endl;
cout<<"Object Oriented Programming"<<endl;
cout<<"Presented to:"<<endl;
cout<<"Mr."<<endl;
cout<<"Presented by the:"<<endl;
cout<<"GROUP "<<endl;
cout<<"July 30, 2009"<<endl;
cout<<"^_^/>"<<endl;
cout<<"\n\n\n\n\nYOU WILL BE ASKED TO INPUT YOUR USERNAME AND PASSWORD AGAIN FOR THE SECURITY OF THE PROGRAM\n";
cout<<"THANK YOU!\n\n\n\n\n";
break;
}
case 2:
{
cout<<"THE PROGRAMMERS:"<<endl;
cout<<"G"<<endl;
cout<<"W"<<endl;
cout<<"O"<<endl;
cout<<"\n\n\n\n\nYOU WILL BE ASKED TO INPUT YOUR USERNAME AND PASSWORD AGAIN FOR THE SECURITY OF THE PROGRAM\n";
cout<<"THANK YOU!\n\n\n\n\n";
break;
}
case 3:
{
cout<<"EASY ROUND:"<<endl;
cout<<"GENERAL RULE: ALL ANSWERS SHOULD BE IN SMALL LETTERS"<<endl;
cout<<"\n\n\n\nEasy round is all about GENERAL SCIENCE.\n\n\n\n";
cout<<"1.What is the first element in the periodic table of element?"<<endl;
cout<<"a. helium"<<endl;
cout<<"b. mercury"<<endl;
cout<<"c. hydrogen"<<endl;
cout<<"d. oxygen"<<endl;
cin>>z1;
if(z1=='c')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"SORRY! YOU ARE WRONG. THE CORRECT ANSWER IS: C\a "<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"2. What is the study of various species of life?"<<endl;
cout<<"a. chemistry"<<endl;
cout<<"b. biology"<<endl;
cout<<"c. physics"<<endl;
cout<<"d. physical science"<<endl;
cin>>z2;
if(z2=='b')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"SORRY! YOU ARE WRONG. THE CORRECT ANSWER IS: B\a "<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"3. Who discovered the telephone?"<<endl;
cout<<"a. Thomas Edison"<<endl;
cout<<"b. Albert Einstein"<<endl;
cout<<"c. Galileo Galilei"<<endl;
cout<<"d. Jimmy Neutron"<<endl;
cin>>z3;
if(z3=='a')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"4. What is the biggest planet in the solar system?"<<endl;
cout<<"a. Mars"<<endl;
cout<<"b. Jupiter"<<endl;
cout<<"c. Saturn"<<endl;
cout<<"d. Vesta"<<endl;
cin>>z4;
if(z4=='b')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"5. What is the basic unit of life?"<<endl;
cout<<"a. blood"<<endl;
cout<<"b. heart"<<endl;
cout<<"c. brain"<<endl;
cout<<"d. cell"<<endl;
cin>>z5;
if(z5=='d')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: D \a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"6. Who is the father of biology?"<<endl;
cout<<"a. Socrates"<<endl;
cout<<"b. Aristotle"<<endl;
cout<<"c. Plato"<<endl;
cout<<"d. none of the above"<<endl;
cin>>z6;
if(z6=='b')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"7. What is the smallest planet in the solar system?"<<endl;
cout<<"a. Pluto"<<endl;
cout<<"b. Mercury"<<endl;
cout<<"c. Mars"<<endl;
cout<<"d. Ceres"<<endl;
cin>>z7;
if(z7=='b')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"YOUR ANSWER IS WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"8. Astronomy is under what field of science?"<<endl;
cout<<"a. physics"<<endl;
cout<<"b. chemistry"<<endl;
cout<<"c. biology"<<endl;
cout<<"d. none of the above"<<endl;
cin>>z8;
if(z8=='d')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"YOUR ANSWER IS WRONG. THE CORRECT ANSWER IS: D\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"9. Who is the cartoon character also known as BOY - GENIUS?"<<endl;
cout<<"a. Ash Ketchum"<<endl;
cout<<"b. Spongebob Squarepants"<<endl;
cout<<"c. Jimmy Neutron"<<endl;
cout<<"d. Astroboy"<<endl;
cin>>z9;
if(z9=='c')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"YOUR ANSWER IS WRONG. THE CORRECT ANSWER IS: C\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"10. What is the highest level of mankind here in earth?"<<endl;
cout<<"a. humans"<<endl;
cout<<"b. animals"<<endl;
cout<<"c. microbes"<<endl;
cout<<"d. none of the above"<<endl;
cin>>z10;
if(z10=='a')
{
easyx=easyx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
easyy=easyy+1;
cout<<"YOUR ANSWER IS WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"^_^/>"<<endl;
cout<<"You have "<<easyx<<" correct answers."<<endl;
cout<<"You have "<<easyy<<" wrong answers."<<endl;
cout<<"Print your score. "<<endl;
cout<<"Input name of output text file: "<<endl;
cin>>aaa;
group7a=fopen(aaa,"w");
fprintf(group7a,"EASY ROUND %d\n",file1);
fprintf(group7a,"Correct answers = %d\n",easyx);
fprintf(group7a,"Wrong answers = %d\n",easyy);
fclose(group7a);
cout<<"\n\n\n\n\nYOU WILL BE ASKED TO INPUT YOUR USERNAMER AND PASSWORD AGAIN FOR THE SECURITY OF THE PROGRAM\n";
cout<<"THANK YOU!\n\n\n\n\n";
break;
}
case 4:
{
cout<<"Average Round"<<endl;
cout<<"GENERAL RULE: ALL ANSWERS SHOULD BE IN SMALL LETTERS"<<endl;
cout<<"\n\n\n\nAVERAGE ROUND IS ALL ABOUT PHYSICAL SCIENCE.\n\n\n\n";
cout<<"1.What is the first man-made satelite?"<<endl;
cout<<"a. sputnik1"<<endl;
cout<<"b. sputnik3"<<endl;
cout<<"c. apollo1"<<endl;
cout<<"d. apollo11"<<endl;
cin>>y1;
if(y1=='a')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"2.What makes Uranus blue?"<<endl;
cout<<"a. carbon dioxide"<<endl;
cout<<"b. helium"<<endl;
cout<<"c. methane"<<endl;
cout<<"d. hydrogen"<<endl;
cin>>y2;
if(y2=='c')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: C\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"3.What is the largest asteroid?"<<endl;
cout<<"a. eris"<<endl;
cout<<"b. ceres"<<endl;
cout<<"c. pluto"<<endl;
cout<<"d. comets"<<endl;
cin>>y3;
if(y3=='b')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"4.What is the largest mountain in the solar system?"<<endl;
cout<<"a. mt.apo"<<endl;
cout<<"b. mt.everest"<<endl;
cout<<"c. olympus wind"<<endl;
cout<<"d. olympus mons"<<endl;
cin>>y4;
if(y4=='d')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: D\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"5.What makes mars red?"<<endl;
cout<<"a. helium"<<endl;
cout<<"b. iron oxide"<<endl;
cout<<"c. hydrogen"<<endl;
cout<<"d. methane"<<endl;
cin>>y5;
if(y5=='b')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"6.What is the hottest planet in the solar system?"<<endl;
cout<<"a. mercury"<<endl;
cout<<"b. jupiter"<<endl;
cout<<"c. venus"<<endl;
cout<<"d. earth"<<endl;
cin>>y6;
if(y6=='c')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: C\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"7.What is the nearest point of a planet to the sun?"<<endl;
cout<<"a. perihelion"<<endl;
cout<<"b. aphelion"<<endl;
cout<<"c. perigee"<<endl;
cout<<"d. apogee"<<endl;
cin>>y7;
if(y7=='a')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"8. When did the first manned moon landing happen?"<<endl;
cout<<"a. May 6, 1969"<<endl;
cout<<"b. July 16, 1908"<<endl;
cout<<"c. July 21, 1969"<<endl;
cout<<"d. none of the above"<<endl;
cin>>y8;
if(y8=='c')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: C\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"9. What is the biggest moon of Jupiter?"<<endl;
cout<<"a. Ganymede"<<endl;
cout<<"b. Callisto"<<endl;
cout<<"c. Io"<<endl;
cout<<"d. Europa"<<endl;
cin>>y9;
if(y9=='a')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"10. What were the first creatures in this world to fly?"<<endl;
cout<<"a. birds"<<endl;
cout<<"b. insects"<<endl;
cout<<"c. butterflies"<<endl;
cout<<"d. none of the above"<<endl;
cin>>y10;
if(y10=='b')
{
avex=avex+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
avey=avey+1;
cout<<"SORRY YOU ARE WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"^_^/>"<<endl;
cout<<"You have "<<avex<<" correct answers."<<endl;
cout<<"You have "<<avey<<" wrong answers."<<endl;
cout<<"Print your score. "<<endl;
cout<<"Input name of output text file: "<<endl;
cin>>bbb;
group7b=fopen(bbb,"w");
fprintf(group7b,"AVERAGE ROUND %d\n",file2);
fprintf(group7b,"Correct answers = %d\n",avex);
fprintf(group7b,"Wrong answers = %d\n",avey);
fclose(group7b);
cout<<"\n\n\n\n\nYOU WILL BE ASKED TO INPUT YOUR USERNAME AND PASSWORD AGAIN FOR THE SECURITY OF THE PROGRAM\n";
cout<<"THANK YOU!\n\n\n\n\n";
break;
}
case 5:
{
cout<<"DIFFICULT ROUND"<<endl;
cout<<"GENERAL RULE: ALL ANSWERS SHOULD BE IN SMALL LETTERS"<<endl;
cout<<"\n\n\n\nDIFFICULT ROUND IS ALL ABOUT SCIENTIFIC NAMES\n\n\n\n";
cout<<"1. What is the scientific name of bat?"<<endl;
cout<<"a. Order Chiroptera"<<endl;
cout<<"b. Order Cetacea"<<endl;
cout<<"c. Order Carnivora"<<endl;
cout<<"d. Order Casanova"<<endl;
cin>>x1;
if(x1=='a')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"2. What is the scientific name of blue whale?"<<endl;
cout<<"a. Balaeniceps rex"<<endl;
cout<<"b. Balaenoptera musculus"<<endl;
cout<<"c. Branta canadensis"<<endl;
cout<<"d. Bufo bufo"<<endl;
cin>>x2;
if(x2=='b')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"3. What is the scientific name of Western Gull?"<<endl;
cout<<"a. Larus occidentalis"<<endl;
cout<<"b. Egretta thula"<<endl;
cout<<"c. Larus argentatus"<<endl;
cout<<"d. Pitecopaga jefferyi"<<endl;
cin>>x3;
if(x3=='a')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"4. What is the scientific name of lion?"<<endl;
cout<<"a. Panthera leo"<<endl;
cout<<"b. Merlion leo"<<endl;
cout<<"c. Cannis Vulpes"<<endl;
cout<<"d. Larus Canus"<<endl;
cin>>x4;
if(x4=='a')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"5. What is the scientific name of peacock?"<<endl;
cout<<"a. Falcon Falco"<<endl;
cout<<"b. Gruidae Gruiformes"<<endl;
cout<<"c. Arboreal Ateles "<<endl;
cout<<"d. Pava Cristatus "<<endl;
cin>>x5;
if(x5=='d')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: D\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"6. What is the scientific name of pig?"<<endl;
cout<<"a. Artiodactyla Suidae"<<endl;
cout<<"b. Equs Asinus"<<endl;
cout<<"c. Rangifer Tarrandus "<<endl;
cout<<"d. Perrissodanctyl Rthinocerotidae"<<endl;
cin>>x6;
if(x6=='a')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: A\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"7. What is the scientific name of mouse?"<<endl;
cout<<"a. Edwinde Dangson"<<endl;
cout<<"b. Rodentia Muridae"<<endl;
cout<<"c. Rangifer Tarrandus"<<endl;
cout<<"d. Acinonyx Jubatus "<<endl;
cin>>x7;
if(x7=='b')
{
hardx=hardx+1;
cout<<"YOUR ANSWER IS CORRECT!"<<endl;
}else{
hardy=hardy+1;
cout<<"IT'S WRONG. THE CORRECT ANSWER IS: B\a"<<endl;
}
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"8. What is the scientific name of tiger?"<<endl;
cout<<"a. Cygnus Coscoroba "<<endl;
&nb
This post has been edited by cziel: 23 August 2009 - 04:43 AM

New Topic/Question
Reply




MultiQuote




|