This document appears to be a C++ program for a quiz game show called "Kaun Banega Crorepati" (Who Will Become a Millionaire). The program includes functions for displaying titles/menus, adding/updating questions and answers stored in a file, playing the quiz game by accessing questions from the file, and checking user answers.
2. ACKNOWLEDGEMENT
In the accomplishment of this project successfully, many
people have best owned upon me their blessing and the
heart pledged support, this time I am utilizing to thank all
the people who have been concerned with project.
Primarily I would thank God for being able to complete
this project with success. Then I would like to thank my
chemistry teacher _________________________,whose
valuable guidance has been the ones that helped me patch
this project and made it successful. Then I would like to
thanks to my parents who have helped me with their
valuable suggestions and guidance has been helpful in
various phases of the completion of the project.
Lastly I would like to thanks to the internet which helped
me in giving the brief and detailed points for my project
and also thanks to the up-loader to upload the valuable
points.
3. Program on KAUN BANEGA
CARORPATI
#include<fstream.h>
#include<dos.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#define tc(str) textcolor(str);
#define cp(str) cprintf(str);
#define tb(str) textbackground(str);
#define tcr(int) textcolor(int);
structcontestent
{
int a;
char n[20];
}s;
structqA
{
7. gotoxy(35,14);
tcr(12) cp("MAIN MENU:");
gotoxy(33,16);
tcr(14) cp("1.ADD QUESTION:");gotoxy(33,18);
tc(BLUE) cp("2.DELETE QUESTION:");gotoxy(33,20);
tcr(18) cp("3.HISTORY:");gotoxy(33,22);
tcr(20) cp("4.UPDATION:"); gotoxy(33,24);
tcr(22) cp("5.EXIT:");
gotoxy(33,26);cout<<"ENTER YOUR CHOICE:";
cin>>i;
switch(i)
{
case 1: creation();
goto up;
case 4: char ch;
int n;
fstream file;
file.open("QuestionAnswer.dat",ios::in|ios::out|ios::binar
y);
do
{
file.read((char *)&s1,sizeof(s1));
8. cout<<"nENTER QUESTION NUMBER
TO BE UPDATED";
cin>>n;
cout<<"nENTER QUESTION:";
gets(s1.q);
cout<<"nENTER FIRST choice (A)':";
gets(s1.ch1);
cout<<"nENTER SECOND CHOICE
(B):";
gets(s1.ch2);
cout<<"nENTER THIRD CHOICE (C):";
gets(s1.ch3);
cout<<"nENTER FOURTH CHOICE
(D):";
gets(s1.ch4);
cout<<"nENTER ANSWER (A/B/C/D):";
cin>>s1.a;
file.seekg((n-1)*sizeof(s1));
file.write((char *)&s1,sizeof(s1));
9. cout<<"nENTER'Y' TO UPDATE
MORE QUESTIONS";
cin>>ch;
}while((ch=='Y')||(ch=='y'));
file.close();
break;
case 5:clrscr();
gotoxy(35,15);
/* switch(ch1)
{
case 'n':
case 'N':
case 2: goto up;
case 'y':
case 'Y':
case 1: clrscr(); gotoxy(34,20);
tcr(19) cp("THANKYOU");
break;
} */
tc(RED) cp("ARE YOU SURE TO WANT TO
EXIT");
tc(GREEN) cp("THANK YOU");
10. break;
}
return i;
}
void creation()
{
clrscr();
charch;
int i=0;
fstream f;
f.open("QuestionAnswer.dat",ios::in|ios::app|ios::bi
nary);
do
{
//f.read((char*)&s1,sizeof(s1));
//f.seekg(0,ios::end);
cout<<"nENTER QUESTION:";
gets(s1.q);
cout<<"nENTER FIRST CHOICE (A):";
gets(s1.ch1);
cout<<"nENTER SECOND CHOICE (B):";
gets(s1.ch2);
cout<<"nENTER THIRD CHOICE (C):";
gets(s1.ch3);
11. cout<<"nENTER FOURTH CHOICE (D):";
gets(s1.ch4);
cout<<"nENTER ANSWER (A/B/C/D):";
cin>>s1.a;
f.write((char*)&s1,sizeof(s1));
cp("ENTER 'Y' TO ADD MORE
QUESTION");
cin>>ch;
}while(ch=='Y');
f.close();
cout<<i<<endl;
}
int accessing(int i)
{
int k;
fstream f1;
char a;
f1.open("QuestionAnswer.dat",ios::in|ios::binary);
while(f1)
{
f1.seekp(i);
f1.read((char*)&s1,sizeof(s1));
gotoxy(24,12);cout<<"Question1:"<<s1.q;