You are on page 1of 7

#include<iostream> #include<string.h> #include<conio.

h> using namespace std; int main() { //All the variables int marks=0; char name[200]; char ans; char yn; cout<<"Hi.(press enter)"; getch(); cout<<"\nWhat's your name? \n \n"; cin.getline(name,199); start: cout<<"Hi,"<<name<<". So you are here for the quiz, right? Press Enter for the Ground Rules"; getch(); cout<<" \n \n1) There will be 15 Questions with four options. You must answer by entering the single letter option only. \n"; cout<<"2) You will be awarded 10 points for the first seven questions, for each right answer and -5 points for every wrong answer. \n"; cout<<"3) To anytime quit the quiz, enter 'q' as the answer of any que stion. \n"; cout<<"Ok, I think that's it! Let's get started right away. Press Ente r for the first Question"; getch();

//Question No. 1 cout<<"\n \n Who is the UN Secretary General?\nA. Kofi Annan B. Ban Ki -moon C. Ann San Suu Kyi D. Nelson Mandela\n \n"; cin>>ans; if(ans=='b' || ans=='B') { cout<<"Great start! Ten points.\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=5; cout<<" Wrong Answer. The right answer is B. Ban Ki-moon . Ban Ki-moon is the eighth and current Secretary-General of the United Nations, after succeeding Kofi Annan in 2007. Before becoming Secretary-General,

Ban was a career diplomat in South Korea's Ministry of Foreign Affairs and in t he United Nations. \n \n "; } cout<<"Scorecard: "<<marks; //Question No. 2 getch(); cout<<"\n \n Who is the CEO of the multinational company, Apple?\nA. S teve Balmer B. Bill Gates C. Steve Jobs D. Tim Cook\n \n"; cin>>ans; if(ans=='d' || ans=='D') { cout<<"Awesome-sauce! Ten points.\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=5; cout<<" Wrong Answer. The right answer is D. Tim Cook. T imothy Donald 'Tim' Cook is an American business executive, and is the CEO of Ap ple Inc. Cook joined Apple in March 1998 as SVP of Worldwide Operati ons and also served as EVP of Worldwide Sales and Operations and was COO until h e was named the CEO of Apple on August 24, 2011, succeeding St eve Jobs. Cook had previously served as acting CEO of Apple after Jobs began med ical leave in January 2011.\n \n"; } cout<<"Scorecard: "<<marks; //Question No. 3 getch(); cout<<"\n \n Who plays the infamous Professor Moriarty, in the BBC se ries, 'Sherlock'?\nA. Andrew Scott B. Jared Harris C. Martin Freeman D. Jude Law \n \n"; cin>>ans; if(ans=='a' || ans=='A') { cout<<"Nice!! Ten more points.\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; }

else { marks-=5; cout<<" Wrong :(. The right answer is A. Andrew Scott. A ndrew Scott is an Irish film, television, and stage actor."; } cout<<"\n Scorecard: "<<marks; //Question No. 4 getch(); cout<<"\n \n Which 17 year old debutant bagged two grammies in the 56t h Grammy Awards(2014)\nA. Adele B. Lorde C. Miley Cyrus D. Lily Collins\n \n"; cin>>ans; if(ans=='B' || ans=='b') { cout<<"Nice!! Ten more points.\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=5; cout<<"Nope. The right answer is B. Lorde. Lorde is the latest teen sensation from New Zealand who won two grammies for her debut single 'Royals'"; } cout<<"Scorecard: "<<marks; //Question No. 5 getch(); cout<<"\n \n Which of the following freedom fighters is called 'Lokman ya' ?\nA. Subhash Chandra Bose B. Bal Gangadhar Tilak C. Mahatma Gandhi D. Bhaga t Singh\n \n"; cin>>ans; if(ans=='b' || ans=='B') { cout<<"Nice!! Ten more points.\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; }

else { marks-=5; cout<<" Wrong :(. The right answer is A. Bal Gangadhar T ilak. \n"; } cout<<"Scorecard: "<<marks; //Question No. 6 getch(); cout<<"\n \n Who is the youngest recipient of the Bharat Ratna ?\nA. J agdish Chandra Bose B. Indira Gandhi C.Sachin Tendulkar D. Milkha Singh\n \n"; cin>>ans; if(ans=='c' || ans=='C') { cout<<"Sachin Tendulkar!! You're doing awesome. Ten more points.\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=5; cout<<" Wrong :(. The right answer is C. The Master Blas ter, Sachin Tendulkar. He is getting this award this year, in 2014. \n"; } cout<<"Scorecard: "<<marks; //Question No. 7 getch(); cout<<"\n \n Who is the most expensive player in 'club football' histo ry?\nA. Cristiano Ronaldo B. Wayne Rooney C.Gareth Bale D. Lionel Messi\n \n"; cin>>ans; if(ans=='C' || ans=='c') { cout<<"Amazingly well done,"<<name<<". Ten points for ya !\n\n"; marks+=10; } else if(ans=='q' || ans=='Q') { goto end; }

else { marks-=5; cout<<" Oh, no."<<ans<<" is wrong! The correct answer is C. Gareth Bale. His transfer from Tottenham Hotspurs to Real Madrid, was the mo st expensive transfer in the history of football(US$ 140 million) \ n"; } cout<<"Scorecard:\n \n "<<marks; //Question No. 8 getch(); cout<<" Ok, now,"<<name<<",you have been doing awesome. You now have " <<marks<<" points. Now the remaining questions are for 20 marks each(Press Enter to continue)"; getch(); cout<<"So, you get 20 points for the right answer and -10 points for the wrong answer. HEADS UP: These questions are heavy."; cout<<"\n \n From which country did chess originate?\nA. Persia B. Ind ia C. Scotland D. Tibet\n \n"; cin>>ans; if(ans=='b' || ans=='B') { cout<<"Twenty points for such a smart-ass like you.\n\n" ; marks+=20; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=10; cout<<" Nope. The right answer is B. India. Come on man, give your country a little respect."; } cout<<" \n Scorecard: "<<marks; //Question No. 9 getch(); cout<<"\n \nEntomology is the science that studies ?\nA.Behavior of hu man beings B. Insects C. The origin and history of technical and scientific term s D. The formation of rocks\n \n"; cin>>ans; if(ans=='b' || ans=='B') {

cout<<"It's smoking hot fire. 20 points for ya\n\n"; marks+=20; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=10; cout<<" Wrong :(. The right answer is B. Insects. Yes, i nsects."; } cout<<"\n Scorecard: "<<marks; //Question No. 10 getch(); cout<<"\n \n How many states are there is the United States of Americ a?\nA. 52 B. 51 C. 53 D. 50\n \n"; cin>>ans; if(ans=='d' || ans=='D') { cout<<"Good job, Chump. 20 marks for the right answer\n\ n"; marks+=20; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=10; cout<<"The right answer was 50!! So close. *fist bump*"; } cout<<"\n Scorecard: "<<marks; //Question No. 11 getch(); cout<<"\n \n What was the code name for the Allied invasion of Norman dy, beginning on D-Day, June 6, 1944??\nA. Operation Herring B.Operation Diver C. Operation Liberty D. Operation Overlord \n \n"; cin>>ans; if(ans=='d' || ans=='D') { cout<<"The Boss!! 20 marks for the boss\n\n";

marks+=20; } else if(ans=='q' || ans=='Q') { goto end; } else { marks-=10; cout<<"No. The right answer was Operation Overlord. Well anyway here is your scorecard: \n"; cout<<"Scorecard: "<<marks; } cout<<"Press Enter to continue \n"; getch(); //Performance Accessor: if(marks<= 50) { cout<<"\n"<<name<<", you need to get out of your room. You need some major brushing up. \n \n"; } if(marks> 50 && marks<= 100) { cout<<name<<".\n Fairly well done, Sailor. \n \n"; } if(marks> 100) { cout<<"\n Amen. _/\_ \n \n"; } goto finale; end: cout<<"So, you want to quit? Are you sure?(y/n)\n"; cin>>yn; if(yn=='y' || yn == 'Y') { goto finale; } if(yn=='n' || yn == 'N') { cout<<"WARNING: Quiz will start again. \n "; goto start; } finale: cout<<"\n Bye-bye, "<<name<<"!!"; }

You might also like