It's basically the project that u need to submit to the external examiner for the cbse class 12 boards exam. This one is on the topic of Quiz Programming. It is compiled using Turbo C++. All the header files are included along with an acknowledgement and a cover page too.
C++ class 12 cbse quiz programming (Compiled using Turbo C++)
1.
2. The Partial fulfillment of Computer
Science course
Project Work on Quiz Programming
Submitted By Submitted
To:
________ ______
(Computer
Teacher)
3. Acknowledgement
I am very thankful to my school who provided me the opportunityto
prepare a project and enhancing my practical skill s regarding
business firm. I am equally thankful to my teacher, Mr.
_____________. He gave me moral support and guided me in
different matters regarding the topic. He had been very kind and
clearing my doubts. Last but not the least, I would like to thank my
parents who helped me in gathering different information, collecting
data and guiding me time in making this project.
I’d like to recognize these special people for providing me in every
manner to make this project a unique and success.
4. //*******Quiz Game*********
//Consisting of 2 sets with 10 questions in each set
//It also includes 50-50 lifeline
#include<iostream.h>
#include<ctype.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
class quiz
{
public:
void set1();
void ques1();
void ques2();
void ques3();
void ques4();
void ques5();
void ques6();
void ques7();
void ques8();
void ques9();
void ques10();
void fifty1();
6. void fifty4();
void fifty5();
void fifty6();
void fifty7();
void fifty8();
void fifty9();
void fifty10();
}s2;
long int pts;
int t=0,flag=0;
char ans[1],w;
************MAIN PART************
void main()
{
clrscr();
int age,q;
char name[30];
gotoxy(20,10);
cout<<”n THIS IS A QUIZ GAME”;
cout<<”nnn FIRST ANSWER THE ELIGIBLE QUESTION TO PLAY
THE GAME”;
cout<<”n Enter the game:-“;
gets(name);
cout<<”n Enter the age:-“;
cin>>age;
8. cout<<”nThis is your eligibility question”;
cout<<”nnn In computer, what is 1 gigabyte?”;
cout<<n(a)1024*2 bytes”<<”t(b)1024*1024*1024 bytes”;
cout<<”n(c)1024*3 bytes”<<”t(d)NONE OF THESE”;
char rs[]=”b”;
cout<<”n Enter your answer:-“;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
clrscr();
cout<<”n You have qualified”;
gotoxy(20,10);
cout<<”n********************************”;
cout<<”n**WELCOME TO THIS GRAND QUIZ SHOW**”;
cout<<”n**************************************”;
cout<<”nnn HERE YOU WILL BE ASKED A QUESTION & FOUR
OPTIONS”;
cout<<”n WILL BE THERE, IN WHICH THREE ARE WRONG AND ONLY
ONE”;
cout<<”n IS CORRECT.YOU HAVE TO GIVE THE CORRECT ANSWER”;
cout<<”n YOU HAVE A 50-50 HELP LINE IN WHICH THERE WILL BE”;
cout<<n ONLY TWO OPTIONS OF WHICH ONE IS CORRECT.YOU”;
cout<<”n HAVE TO GIVE THE CORRECT ANSWER.WRONG ANSWER
MEANS YOU “;
9. cout<<”n FINISH THE GAME THERE ONLY”;
cout<<”n ********YOU CAN TAKE ONLY THREE HELP LINES*****”;
cout<<”nnn PRESS ENTER TO START THE GAME”;
getch();
s1.ques1();
}
else
{
cout<<”a UNSUCCESSFUL a”;
cout<<”nntt BETTER LUCK NEXT TIME”;
getch();
}
}
//*****************************QUESTION 1****************************
void quiz::ques1()
{
clrscr();
cout<<”n What do you mean by hexadecimal in computer?”;
cout<<”n (a) With a base of 16”<<”t(b)With a base of 6”;
cout<<”n (c) With a base of 8”<<”t(d) NONE OF THESE”;
char rs[]=”a”;
cout<<”n DO YOU WANT 50/50 LIFELINE (Y/N)”;
cin>>w;
if(w==’Y’||w==’y’)
{
10. flag++;
s1.fifty1();
}
cout<<”n Please give your answer:-“;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=1000;
gotoxy(50,22);
cout<<”YOUR SCORE:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques2();
}
else
{
cout<<”a UNSUCCESSFULa”;
getch();
}
}
void quiz::fifty1()
{
clrscr();
11. cout<<”n What do you mean by Hexadecimal in computer?”;
cout<<”n (a) With a base of 16”<<”t(b) With a base of 6”;
}
//***********************QUESTION 2*************************
void quiz::ques2()
{
clrscr();
cout<<”n Who has written the book ‘DIVINE LIFE’?”;
cout<<”n (a) Charles Dickens”<<”t (b)Dante Alighieri”;
cout<<”n (c) Swami Sivananda”<<”t(d) Karl Max”;
char rs[]=”c”;
cout<<”n DO YOU WANT 50-50 LIFELINE (Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s1.fifty2();
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
12. {
pts=2000;
gotoxy(50,22);
cout<<” YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEYY FOR THE NEXT QUESTION”;
getch();
s1.ques3();
}
else
{
cout<<”aUNSUCCESSFULa;
}
}
void quiz::fifty2()
{
clrscr();
cout<<”n Who has written the book ‘THE DIVINE LIFE’?”
cout<<”n (c)Swami Sivananda”<<t(d)Karl Marx”;
}
******************QUESTION 3*******************
void quiz::ques3()
{
clrscr();
cout<<”n Who has written the book ‘ONE LIFE’?”;
13. cout<<”n (a) Christian Barnard”<<”t(b)Wendell Wilkie”;
cout<<”n (c)Williamm Wordsworth”<<”t(d)Charles Darwin”;
char rs[]=”a”;
cout<<”n DO YOU WANT 50-5- LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s1.fifty3();
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=3000;
gotoxy(50,22);
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques4();
}
else
{
14. cout<<”a UNSUCCESSFULLa”;
}
}
void quiz::fifty3()
{
clrscr();
cout<<”n Who has written the book ‘ONE LIFE’?”;
cout<<”n (a) Christian Barnard”<<”n (c) William Wordsworth”;
}
*******************QUESTION 4************************
void quiz::ques4()
{
clrscr();
cout<<”n Which game is associated with ‘YONEX CUP’?”;
cout<<”n (a) Golf”<<:t(b)Baseball”;
cout<<”n (c) Yatch Racing”<<”t(d)Badminton”;
char rs[]=”d”;
if(flag&It;3)
{
flag++;
cout<<”n DO YOU WANT 50-50 LIFELINE (Y/N)”;
cin>>w;
15. if(w==’y’||w==’Y’)
{
flag++;
s1.fifty4();
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=5000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques5();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz::fifty4()
17. cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=5000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques5();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz::fifty5();
{
clrscr();
cout<<”n Who invented ‘MECHANICAL CLOCK’?”;
cout<<”nt(b)Samuel Colt”<<”n(c)Hsing and Ling-Tsan”;
}
18. ****************QUESTION 6*****************
void quiz::ques6()
{
clrscr();
cout<<”n Who invented ‘ELECTRIC RAZOR’?”;
cout<<”n (a)K.G.Gillet”<<”t(b)Viscose Co.”;
cout<<”n(c)L.C.Young”<<”t(d)Col.J.Schick”;
char rs[]=”d”;
if(flag&It;3)
{
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s1.fifty6();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
19. pts=5000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques7();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz::fifty6()
{
clrscr();
cout<<”n Who invented ‘ELECTRIC CLOCK’?”;
cout<<”nt(b)Viscose Co.”<<”nt(d)Col.J.Schick”;
}
******************QUESTION 7****************
void quiz::ques7()
{
clrscr();
cout<<”n Who invented ‘WATERPROOF RUBBER’?”;
20. cout<<”n(a)A.Catlin”<<”t(b)Charles GoodYear”;
cout<<”n(c)J.Harrison”<<”t(d)Charles Macintosh”;
char rs[]=”d”;
if(flag&It;3)
{
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s1.fifty7();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=40000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
21. s1.ques8();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz::fifty7()
{
clrscr();
cout<<”Who invented ‘WATERPROOF RUBBER’?”;
cout<<”nt(b)Charles GoodYear”<<”nt(d)Charles Macintosh”;
}
******************QUESTION 8****************
void quiz::ques8()
{
clrscr();
cout<<”n Where the disease named ‘GLAUCOMA’ is affected in the body’?”;
cout<<”n(a)Skin”<<”t(b)Eyes”;
cout<<”n(c)Spleen”<<”t(d)blood”;
char rs[]=”d”;
if(flag&It;3)
{
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
22. if(w==’y’||w==’Y’)
{
flag++;
s1.fifty8();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=80000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques9();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
23. void quiz::fifty8()
{
clrscr();
cout<<”Where is the disease named ‘GLAUCOMA’ is affected in the
body’?”;
cout<<”nt(b)Eyes”<<”nt(c)Spleen”;
}
******************QUESTION 9****************
void quiz::ques9()
{
clrscr();
cout<<”n When was Abraham Lincoln re-elected as president of USA’?”;
cout<<”n(a)1864”<<”t(b)1814”;
cout<<”n(c)1865”<<”t(d)1819”;
char rs[]=”d”;
if(flag&It;3)
{
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s1.fifty9();
}
24. }
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=160000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s1.ques10();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz::fifty9()
{
clrscr();
cout<<”When was Abraham Lincoln re-elected as the president of
USA’?”;
cout<<”nt(a)1864”<<”nt(c)1865”;
25. }
******************QUESTION 10****************
void quiz::ques10()
{
clrscr();
cout<<”n Who invented ‘TELEPHONE’?”;
cout<<”n(a)Albert Einstein”<<”t(b)Graham Bell”;
cout<<”n(c)J.Harrison”<<”t(d)Charles Macintosh”;
char rs[]=”d”;
if(flag&It;3)
{
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s1.fifty10();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
26. t=strcmp(ans,rs);
if(t==0)
{
pts=320000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
clrscr();
cout<<”n************************************************”;
cout<<”n CONGRATS YOU HAVE COMPLETED”;
cout<<”n*****************************”;
}
else
{
cout<<”UNSUCCESSFULLa”;
}
}
s1.ques8();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
27. void quiz::fifty10()
{
clrscr();
cout<<”Who invented ‘TELEPHONE’?”;
cout<<”nt(a)Albert Einstein”<<”nt(b)Graham Bell”;
}
//*****************End Of Set 1*****************
//*****************SET 2******************
void quiz::set2()
{
clrscr();
cout<<”n This is your eligibility question”;
cout<<”nnn The provisional Government Of India was formet at?”;
cout<<”n(a)Tokyo”<<”t(b)Singapore”;
cout<<”n(c)Jakarta”<<”t(d)Kuala Lumpur”;
char rs[]=”b”;
cout<<”nEnter you answer:-“;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
clrscr();
28. cout<<”n You have qualified”;
gotoxy(20,10);
cout<<”n********************************”;
cout<<”n**WELCOME TO THIS GRAND QUIZ SHOW**”;
cout<<”n**************************************”;
cout<<”nnn HERE YOU WILL BE ASKED A QUESTION & FOUR
OPTIONS”;
cout<<”n WILL BE THERE, IN WHICH THREE ARE WRONG AND
ONLY ONE”;
cout<<”n IS CORRECT.YOU HAVE TO GIVE THE CORRECT
ANSWER”;
cout<<”n YOU HAVE A 50-50 HELP LINE IN WHICH THERE WILL BE”;
cout<<n ONLY TWO OPTIONS OF WHICH ONE IS CORRECT.YOU”;
cout<<”n HAVE TO GIVE THE CORRECT ANSWER.WRONG
ANSWER MEANS YOU “;
cout<<”n FINISH THE GAME THERE ONLY”;
cout<<”n ********YOU CAN TAKE ONLY THREE HELP LINES*****”;
cout<<”nnn PRESS ENTER TO START THE GAME”;
getch();
s2.ques1();
}
else
{
cout<<”a UNSUCCESSFUL a”;
getch();
}
29. }
******************QUESTION 1****************
void quiz2::ques1()
{
clrscr();
cout<<”n The British Viceroy who took a no. of measures for preserving ”;
cout<<”n ancient buildings and monuments in India was…?”;
cout<<”n(a)Lord Rippon”<<”t(b)Lord Curzon”;
cout<<”n(c)Lord Minton”<<”t(d)Lord Irwin”;
char rs[]=”d”;
if(flag&It;3)
{
flag++
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s2.fifty1();
}
}
}
cout<<”n Please give your answer”;
31. ******************QUESTION 2****************
void quiz2::ques2()
{
clrscr();
cout<<”n The name of 3rd
bird sanctuary at bharatpur is..??”;
cout<<”n(a)Bhansrod Garh Sanctuary”<<”t(b)Darrah Sanctuary”;
cout<<”n(c)Ghana Sanctuary”<<”t(d)Ghatprabha Sanctuary”;
char rs[]=”d”;
if(flag&It;3)
{
flag++
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s2.fifty2();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
32. if(t==0)
{
pts=2000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s2.ques3();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz2::fifty2()
{
clrscr();
cout<<”The name of the 3rd
bird sanctuary if bharatpur is…?”;
cout<<”nt(a)Bhansrod Garh Sanctuary”<<”nt(c)Ghana Sanctuary”;
}
******************QUESTION 3****************
void quiz2::ques3()
{
33. clrscr();
cout<<”n Who is known as the ‘Father of Geometry’ ?”;
cout<<”n(a)Kepler”<<”t(b)Euclid”;
cout<<”n(c)Pythagora”<<”t(d)Newton”;
char rs[]=”d”;
if(flag&It;3)
{
flag++
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s2.fifty3();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=3000;
gotoxy(50,22)
34. cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s2.ques4();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz2::fifty3()
{
clrscr();
cout<<”Who is known as the ‘Father Of Geometry’?”;
cout<<”nt(b)Euclid”<<”nt(c)Pythagoras”;
}
******************QUESTION 4****************
void quiz2::ques4()
{
clrscr();
cout<<”n How many centuries did Sachin score against Kenya?”;
cout<<”n(a)2”<<”t(b)3”;
cout<<”n(c)6”<<”t(d)4”;
35. char rs[]=”d”;
if(flag&It;3)
{
flag++
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s2.fifty4();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=5000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s2.ques5();
36. }
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz2::fifty4()
{
clrscr();
cout<<”n How many centuries did Sachin score against Kenya?”;
cout<<”nt(c)6”<<”nt(d)4”;
}
******************QUESTION 5****************
void quiz2::ques5()
{
clrscr();
cout<<”The disease caused in apple by bacteria is..?”;
cout<<”n(a)Wild Fire disease”<<”t(b)Black rot disease”;
cout<<”n(c)Ring disease”<<”t(d)Fire bright disease”;
char rs[]=”d”;
if(flag&It;3)
{
flag++
37. cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s2.fifty5();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=10000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s2.ques5();
}
else
{
cout<<”a UNSUCCESSFULLa”;
38. }
}
void quiz2::fifty6()
{
clrscr();
cout<<”n The disease caused by bacteria in apple is…?”;
cout<<”nt(c)Wild fire disease”<<”nt(d)Fire blight disease”;
}
******************QUESTION 6****************
void quiz2::ques6()
{
clrscr();
cout<<”Blood calcium level can be increased by administration of..?”;
cout<<”n(a)Glucagon”<<”t(b)Parathormone”;
cout<<”n(c)Thyroxine”<<”t(d)Calcitonin”;
char rs[]=”d”;
if(flag&It;3)
{
flag++
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
39. flag++;
s2.fifty6();
}
}
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=20000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s2.ques7();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz2::fifty6()
{
40. clrscr();
cout<<”n Blood calcium level can be increased by the administration of?”;
cout<<”nt(b)Parathormone”<<”nt(c)Thyroxine”;
}
******************QUESTION 7****************
void quiz2::ques7()
{
clrscr();
cout<<”n An element E from a solid oxide which dissolves in water to ?”;
cout<<”n give an acidic solution, the element E is…?”;
cout<<”n(a)H”<<”t(b)P”;
cout<<”n(c)Mg”<<”t(d)N”;
char rs[]=”d”;
if(flag&It;3)
{
flag++
cout<<”n DO YOU WANT 50-50 LIFELINE(Y/N)”;
cin>>w;
if(w==’y’||w==’Y’)
{
flag++;
s2.fifty7();
}
41. }
}
cout<<”n Please give your answer”;
cin>>ans;
strlwr(ans);
t=strcmp(ans,rs);
if(t==0)
{
pts=40000;
gotoxy(50,22)
cout<<”YOUR SCORE IS:-“<<pts;
cout<<”n PRESS ANY KEY FOR THE NEXT QUESTION”;
getch();
s2.ques8();
}
else
{
cout<<”a UNSUCCESSFULLa”;
}
}
void quiz2::fifty7()
{
clrscr();
cout<<”n An element E from a solid oxide which dissolves in water?”;
cout<<”n to give an acidic solution, the element E is…?”