Академический Документы
Профессиональный Документы
Культура Документы
INVESTIGATORY PROJECT
2017-18
Ayush
Sharma
CLASS—XI-A
ROLL NO. : 08
ACKNOWLEDGEMENT
Ayush Sharma
XI-A
CERTIFICATE
Mr. P.N.CHAKI
PGT(Computer
Science)
IIT Kanpur
Help Line of Flow
of Control
2. Source Code
3. Output
4. Bibliography
Introduction
This 'QUIZ GAME' Project is designed for a question in
which you can generate and manage a simple database
for questions. The question number is automatically
generated by the software and is stored in a binary file
by the name 'QUESTION'. This data base is basically
used as a MASTER file to be used as a look-up table for
information like Quiz Option, SubMenu, either
Computer/Mathematics/Science or General and the
Return. In this software you can ask for any Menu on
the basis of the Menu Question will be asked to the user
& the user gets time for answering the question. If the
user is correct the he get 10 points on every question. If
he is incorrect then he lost the game & game is closed.
Source Code
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,n;
x=0;
char choice[100],ch1;
cout<<"\n\n\t\t *************";
cout<<"\n\n\t\t * Quiz Game *";
cout<<"\n\n\t\t *************";
cout<<"\n\n\t\t====================================";
cout<<"\n\n\t\t= Developed By :Ayush Sharma =";
cout<<"\n\n\t\t====================================";
cout<<"\n\n";
cout<<"\n Please Enter Your Name : ";
cin>>choice;
clrscr();
cout<<"\n\n";
cout<<"\n\n\t\t Welcome "<<choice<<"\n";
cout<<"\n\n\t\t Loading Please wait........";
cout<<"\n\n\t\t 1) Start Quiz";
cout<<"\n\n\t\t 2) View Score";
cout<<"\n\n\t\t 3) Exit Quiz";
cout<<"\n\n Enter Your Choice :--> ";
cin>>n;
clrscr();
switch(n)
{
case 1:
cout<<"\n\n\n Note :Enter answer in the a,b,c
and d only...";
cout<<"\n\n\n";
cout<<"Which of the following type of class
allows only one object of it to be created ?";
cout<<"\n\n A.Virtual Class \n\n B.Abstract
Class \n\n C.Singleton Class \n\n D.Friend Class";
cout<<"\n\n Enter Your Select answer : ";
cin>>ch1;
if(ch1=='c')
{
x=x+1;
cout<<"\n\n Correct Answer....";
}
else
cout<<"\n\n Sorry Wrong Answer....";
getch();
cout<<"\n\n\n";
cout<<"Which of the following is not a type of
constructor ?";
cout<<"\n\n A.Copy Constructor \n\n B.Friend
Constructor \n\n C.Default Constructor \n\n
D.Parameterized Constructor";
cout<<"\n\n Enter Your Select answer : ";
cin>>ch1;
if(ch1=='b')
{
x=x+1;
cout<<"\n\n Correct Answer....";
}
else
cout<<"\n\n Sorry Wrong Answer..";
cout<<"\n\n\n";
cout<<"RunTime Polymorphism is achieved by___";
cout<<"\n\n A.Friend Function \n\n B.Operator
Overloading \n\n C.Function Overloading \n\n D.Virtual
Function";
cout<<"\n\n Enter Your Select answer : ";
cin>>ch1;
if(ch1=='d')
{
x=x+1;
cout<<"\n\n Correct Answer...";
}
else
cout<<"\n\n Sorry Wrong Answer....";
getch();
cout<<"\n\n\n";
cout<<"Which of the following cannot be used
with the Keyword 'Virtual' ?";
cout<<"\n\n A.Constructor \n\n B.Member function
\n\n C.Destructor \n\n D.Class";
cout<<"\n\n Enter Your Selected answer : ";
cin>>ch1;
if(ch1=='a')
{
x=x+1;
cout<<"\n\n Correct Answer.....";
}
else
cout<<"\n\n Sorry Wrong Answer....";
getch();
cout<<"\n\n\n";
cout<<"Which of the following is not a type of
inheritance ?";
cout<<"\n\n A.Multiple \n\n B.Distributive \n\n
C.Multilevel \n\n D.Hierarchical";
cout<<"\n\n Enter Your Select answer : ";
cin>>ch1;
if(ch1=='b')
{
x=x+1;
cout<<"\n\n Correct Answer...";
}
else
cout<<"\n\n Sorry Wrong Answer....";
getch();
cout<<"\n\n\n";
cout<<"Which of the following is an invalid
visibility label while inheriting a class";
cout<<"\n\n A.Public \n\n B.Private \n\n
C.Friend \n\n D.Protected";
cout<<"\n\n Enter Your Select answer : ";
cin>>ch1;
if(ch1=='c')
{
x=x+1;
cout<<"\n\n Correct Answer...";
}
else
case 2:
if(x==50)
cout<<"\n\n Congratulations......You are
extremely intelligent";
else if(x<=50)
cout<<"\n Total Score is : "<<x;
cout<<"\n\n Enter Your Choice :--> ";
cin>>n;
case 3:
int reply;
cout<<"\n\n Are Sure you want to exit quiz ? Y/N
:";
cin>>reply;
if(reply=='Y')
{
goto out;
}
}
out:
getch();
}
Output
Bibliography
http://www.cplusplus.com
https://www.geeksforgeeks.org/