Академический Документы
Профессиональный Документы
Культура Документы
BENGALURU
A PROJECT REPORT ON
“KBC Quiz”
For the session
2018-19
1
CERTIFICATE
______________ ______________
Mrs. Vadivukkarasi A Mrs. Susan Barrid
(PGT Computer Science) (Principal)
______________
(External Examiner)
2
TABLE OF CONTENTS
1 Acknowledgement
2 Preface
3 System Requirements
4 Instruction Manual
5 Source Code
7 Bibliography
3
ACKNOWLEDGEMENT
4
PREFACE
5
SYSTEM REQUIREMENTS
Microsoft Windows/XP/Vista/Windows 7:
Processor: 800 MHz Intel Pentium III or
equivalent.
Memory: 128 MB or more.
Ubuntu 9.10:
Processor: 800 MHz Intel Pentium III or
equivalent.
Memory: 128 MB or more.
6
INSTRUCTION MANUAL
7
SOURCE CODE
//KBC Program
#include<graphics.h>
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<process.h>
#include<string.h>
#include<dos.h>
void startscreen();
void music();
void main()
{
clrscr();
8
}
startscreen();
int age;
char Name[20]={ ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
int qans1[6]={1,2,4};
int qans2[6]={4,1,4};
int qans3[6]={1,4,1};
int qans4[6]={3,4,4};
int qans5[6]={2,3,1};
int qans6[3]={3,4,3};
int qans7[3]={4,3,2};
int qans8[3]={2,4,4};
int qans9[3]={4,2,3};
int qans10[3]={3,1,4};
int answer;
void Qbank(int);
randomize();
cout<<"\t\t Welcome to the Quiz Show\n\n\n\n ";
cout<<"\tEnter your Name: ";
gets(Name);
cout<<"\tWelcome to the show, " << Name;
cout<<"\n\tSo,How old are you ? ";
cin>>age;
cout<<"\n\tAmazing! So lets start the show";
cout<<"\n\tSo the Rules are very Simple";
cout<<"\n\tYou will be asked 10 questions";
cout<<"\n\tEach question will have four options out of which one is correct";
cout<<"\n\tEnter the correct option from 1 to 4";
cout<<"\n\tThe questions progressively get harder";
//Insert time loop
cout<<"\n\tSo here is the first question\n";
9
int flag = 0;
int qnum = random(3) + 1;
Qbank( qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans1[qnum-1]){
goto lab1;}
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 100 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 4;
cout<<"\n\tTime for the second question\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans2[qnum-4])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 200 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 7;
cout<<"\n\tOnto the third question then\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
10
if(answer != qans3[qnum-7])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 500 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 10;
cout<<"\n\tLets move onto the fourth question\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans4[qnum-10])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 1000 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 13;
cout<<"\n\tFifth Question it is!\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans5[qnum-13])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 4000 points\n";
cout<<"\n\tPress Enter key for the next question";
11
getch();
clrscr();
qnum = random(3) + 16;
cout<<"\n\tLets play the sixth question now\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans6[qnum-16])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 7500 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 19;
cout<<"\n\tIts time for seventh question!\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans7[qnum-19])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 10000 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 22;
cout<<"\n\tIts time for eighth question!\n";
flag++;
12
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans8[qnum-22])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 30000 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 25;
cout<<"\n\tAH!The ninth question!We are close to the end\n";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
if(answer != qans9[qnum-25])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 70000 points\n";
cout<<"\n\tPress Enter key for the next question";
getch();
clrscr();
qnum = random(3) + 28;
cout<<"\n\tSo its the tenth question.This is the most important question\n\t of the
game\n";
cout<<"\tPlay with caution";
flag++;
Qbank(qnum);
cout<<"\n\t";
cin>>answer;
13
if(answer != qans10[qnum-28])
goto lab1;
cout<<"\n\t";
cout<<"\n\tWow you got the correct answer!You have earned 100000 points\n";
cout<<"\n\t\t\t You have won the game!!!! ";
cout<<"\n**********************************************************************
**********";
cout<<"\n\t\t\t Press any key to exit";
getch();
exit(0);
{ lab1 : cout<<"\n\tSorry,you lost!\n";
switch(flag)
{
case 0:
{cout<<"\n\tYou won no points\n";
break;
}
case 1:
{cout<<"\n\tYou won 100 points\n";
break;
}
case 2:
{cout<<"\n\tYou won 200 points\n";
break;
}
case 3:
{cout<<"\n\tYou won 500 points\n";
break;
}
case 4:
{cout<<"\n\tYou won 1000 points\n";
14
break;
}
case 5:
{cout<<"\n\tYou won 4000 points\n";
break;
}
case 6:
{cout<<"\n\tYou won 7500 points\n";
break;
}
case 7:
{cout<<"\n\tYou won 10000 points\n";
break;
}
case 8:
{cout<<"\n\tYou won 30000 points\n";
break;
}
case 9:
{cout<<"\n\tYou won 70000 points\n";
break;
}
case 10:
{cout<<"\n\tYou won 100000 points\n";
break;
}
}
getch();
}
}
void Qbank(int x)
15
{
switch(x)
{
case 1:
{
cout<<"\n\t\t1.Which of the following is not an OCEAN Current? ";
cout<<"\n\t\t(1)Arabian (2)Labrador";
cout<<"\n\t\t(3)Kurushio (4)Gulf Stream";
break;
}
case 2:
{
cout<<"\n\t\t1.Which of the following is a color of the rainbow? ";
cout<<"\n\t\t(1)Brown (2)Indigo";
cout<<"\n\t\t(3)Black (4)Pink ";
break;
}
case 3:
{
cout<<"\n\t\t1.Which of the following is NOT an European Country?";
cout<<"\n\t\t(1)Malta (2)Ireland";
cout<<"\n\t\t(3)Spain (4)Sudan";
break;
}
case 4:
{
cout<<"\n\t\t2.Who is the wife of Lakshman in the Epic Ramayana? ";
cout<<"\n\t\t(1)Mandakini (2)Ambika";
cout<<"\n\t\t(3)Sita (4)Urmila";
break;
}
16
case 5:
{
cout<<"\n\t\t2.Which of these vegetables is a tuber? ";
cout<<"\n\t\t(1)Tapioca (2)Jackfruit";
cout<<"\n\t\t(3)Tomato (4)Spinach";
break;
}
case 6:
{
cout<<"\n\t\t2.Who was the first president of a Free India? ";
cout<<"\n\t\t(1)Indira Gandhi (2)M.K. Gandhi";
cout<<"\n\t\t(3)Jawaharlal Nehru (4)Rajendra Prasad ";
break;
}
case 7:
{
cout<<"\n\t\t3.Who propogated the Advaitha Vedanta ? ";
cout<<"\n\t\t(1)Sankaracharya (2)Bhrigu ";
cout<<"\n\t\t(3)Saint Valmiki (4)Ramane Maharishi";
break;
}
case 8:
{
cout<<"\n\t\t3.Who discovered the antibiotic,penicillin? ";
cout<<"\n\t\t(1)Robert Hooke (2)Lee Van Hock";
cout<<"\n\t\t(3)Ian Fleming (4)Alexander Fleming";
break;
}
case 9:
{
cout<<"\n\t\t3.Which of the following terms IS associated with cricket? ";
17
cout<<"\n\t\t(1)Silly point (2)3-pointer";
cout<<"\n\t\t(3)Volley (4)Sprint";
break;
}
case 10:
{
cout<<"\n\t\t4.Which of the SMALLEST ANIMAL among these? ";
cout<<"\n\t\t(1)Euglena (2)Flea";
cout<<"\n\t\t(3)Tardigrade (4)Ant";
break;
}
case 11:
{
cout<<"\n\t\t4.Which king came to be known as the Napolean of India? ";
cout<<"\n\t\t(1)Mohammed Ghori (2)Prithviraj Chauhan";
cout<<"\n\t\t(3)Ashoka (4)Samudragupta";
break;
}
case 12:
{
cout<<"\n\t\t4.What was another name for Chanakya? ";
cout<<"\n\t\t(1)Ratnagupta (2)Shivagupta";
cout<<"\n\t\t(3)Sampati (4)Vishnugupta";
break;
}
case 13:
{
cout<<"\n\t\t5.Which of these plays is not written by Shakespeare ";
cout<<"\n\t\t(1)Merchant of Venice (2)Great Expectations";
cout<<"\n\t\t(3)Macbeth (4)Tempest";
break;
18
}
case 14:
{
cout<<"\n\t\t5.Which of these is NOT a type of fabric? ";
cout<<"\n\t\t(1)Chiffon (2)Nylon";
cout<<"\n\t\t(3)Calamine (4)Nilex";
break;
}
case 15:
{
cout<<"\n\t\t5.Which of these is a type of Fertilizer? ";
cout<<"\n\t\t(1)N.P.N. (2)T.N.T.";
cout<<"\n\t\t(3)R.D.X. (4)C4 ";
break;
}
case 16:
{
cout<<"\n\t\t6.Which is the hottest planet in the solar system? ";
cout<<"\n\t\t(1)Jupiter (2)Mars";
cout<<"\n\t\t(3)Venus (4)Mercury";
break;
}
case 17:
{
cout<<"\n\t\t6.Who is the Greek god of sleep? ";
cout<<"\n\t\t(1)Artemis (2)Kronos";
cout<<"\n\t\t(3)Somnus (4)Morpheus";
break;
}
case 18:
{
19
cout<<"\n\t\t6.In which year did the First Battle of Panipat occur? ";
cout<<"\n\t\t(1)1837 (2)1745";
cout<<"\n\t\t(3)1526 (4)1590";
break;
}
case 19:
{
cout<<"\n\t\t7.Between which two countries was the 100 Year War fought? ";
cout<<"\n\t\t(1)Italy-Spain (2)England-Spain";
cout<<"\n\t\t(3)Ireland-Germany (4)England-France";
break;
}
case 20:
{
cout<<"\n\t\t7.From what plant is vanilla obtained? ";
cout<<"\n\t\t(1)Malt (2)Barley";
cout<<"\n\t\t(3)Orchid (4)Violet";
break;
}
case 21:
{
cout<<"\n\t\t7.Which law is used to measure the distance between stars? ";
cout<<"\n\t\t(1)Laplace Law (2)Werns Displacement Law";
cout<<"\n\t\t(3)Stokes Law (4)Newton-Boltzman Theorem";
break;
}
case 22:
{
cout<<"\n\t\t8.Which of these metals is non-sonorous? ";
cout<<"\n\t\t(1)Cobalt (2)Lithium";
cout<<"\n\t\t(3)Scandium (4)Titanium";
20
break;
}
case 23:
{
cout<<"\n\t\t8.Which of the following charcters had a Speech Impediment? ";
cout<<"\n\t\t(1)Stuart (2)Laurel";
cout<<"\n\t\t(3)Uncle Scrooge (4)Malaprop";
break;
}
case 24:
{
cout<<"\n\t\t8.Who defeated Napolean in the Battle of Waterloo? ";
cout<<"\n\t\t(1)Lord Patterson (2)Lord Duncan";
cout<<"\n\t\t(3)Lord Chesterfield (4)Lord Wellington";
break;
}
case 25:
{
cout<<"\n\t\t9.In whose court was Tansen a member? ";
cout<<"\n\t\t(1)Babur (2)Aurangzeb";
cout<<"\n\t\t(3)Tughlaq Shah (4)Akbar";
break;
}
case 26:
{
cout<<"\n\t\t9.Which of these ships was NOT a part of Columbus' Fleet? ";
cout<<"\n\t\t(1)Santa Maria (2)La Gorda";
cout<<"\n\t\t(3)Pinta (4)Nina";
break;
}
case 27:
21
{
cout<<"\n\t\t9.Which of these tourist attractions is situated on an island? ";
cout<<"\n\t\t(1)Ellora caves (2)Ajanta caves";
cout<<"\n\t\t(3)Elephanta caves (4)Kankheri caves";
break;
}
case 28:
{
cout<<"\n\t\t10.What was the first minesterial portfolio held by\n Indira Gandhi? ";
cout<<"\n\t\t(1)Home Affairs (2)Science";
cout<<"\n\t\t(3)Broadcasting (4)Education";
break;
}
case 29:
{
cout<<"\n\t\t10.Which of these is the name of an island and a type of coffee? ";
cout<<"\n\t\t(1)Java (2)Mocha";
cout<<"\n\t\t(3)Arabica (4)Oolong";
break;
}
case 30:
{
cout<<"\n\t\t10.Bahubali festival is related to which religion? ";
cout<<"\n\t\t(1)Hinduism (2)Islam";
cout<<"\n\t\t(3)Buddhism (4)Jainism";
break;
}
}
}
void startscreen()
{
22
setlinestyle(0,0,3);
setcolor(BLUE);
setfillstyle(1,BLUE);
circle(300,225,225);
floodfill(300,200,BLUE);
setcolor(LIGHTBLUE);
setfillstyle(1,LIGHTBLUE);
circle(300,225,185);
floodfill(300,200,LIGHTBLUE);
setcolor(0);
setfillstyle(SLASH_FILL,0);
setlinestyle(1,0,0);
for(int p=0;p<=185;p++)
{ circle(300,225,p);
delay(10);
}
setlinestyle(1,0,3);
setcolor(BLUE);
setfillstyle(7,BLUE);
fillellipse(300,225,30,185);
fillellipse(300,225,185,30);
setcolor(BLUE);
setcolor(15);
setfillstyle(1,15);
setcolor(15);
settextstyle(8,0,5);
settextstyle(0,0,3);
outtextxy(100,125,"K");
outtextxy(125,85,"A");
outtextxy(155,55,"U");
23
outtextxy(195,25,"N");
outtextxy(300,10,"B");
outtextxy(350,20,"A");
outtextxy(395,35,"N");
outtextxy(435,65,"E");
outtextxy(465,105,"G");
outtextxy(485,140,"A");
setcolor(YELLOW);
outtextxy(495,180,"?");
outtextxy(85,180,"?");
outtextxy(495,250,"");
outtextxy(85,250,"");
setcolor(15);
outtextxy(100,305,"K");
outtextxy(125,345,"A");
outtextxy(155,375,"U");
outtextxy(195,405,"N");
outtextxy(300,420,"B");
outtextxy(350,415,"A");
outtextxy(395,395,"N");
outtextxy(435,365,"E");
outtextxy(465,335,"G");
outtextxy(485,290,"A");
setlinestyle(1,0,3);
setcolor(5);
setfillstyle(0,5);
circle(300,225,185);
settextstyle(12,0,5);
setcolor(10);
outtextxy(510,470,"Rohan and Adwait");
setlinestyle(1,0,1);
24
setcolor(15);
settextstyle(8,0,5);
outtextxy(265,195," E ");
sound(1000);
delay(600);
outtextxy(215,195," R ");
outtextxy(315,195," P ");
sound(1100);
delay(600);
sound(1200);
delay(500);
outtextxy(170,195," O ");
outtextxy(365,195," A ");
sound(1000);
delay(500);
sound(1100);
delay(550);
outtextxy(115,195," R ");
outtextxy(400,195," T ");
sound(1200);
delay(450);
sound(1350);
delay(450);
outtextxy(85,195,"C ");
outtextxy(500,195,"I");
sound(1500);
delay(1000);
nosound();
settextstyle(0,0,1);
outtextxy(10,460,"PRESS ANY KEY TO CONTINUE ");
getch();
25
clrscr();
}
void music()
{
sound(1000);
delay(600);
sound(1100);
delay(600);
sound(1200);
delay(500);
sound(1000);
delay(500);
sound(1100);
delay(550);
sound(1200);
delay(450);
sound(1350);
delay(450);
sound(1500);
delay(1000);
nosound();
}
26
SCREENSHOTS OF THE OUTPUTS
27
Sample output 2: (When the answer is correct)
28
Sample output 3: (When the answer is wrong)
29
30
BIBLIOGRAPHY
Internet Resources:-
www.tutorialspoint.com/cplusplus
stackoverflow.com
www.cplusplus.com
Other Resources:-
Computer Science with C++, Class XII, Textbook I
By Sumita Arora
31