You are on page 1of 24

C++ Game Project

INTRODUCTION
This Quiz game is divided into three levels. First level contains easy
questions and second level contain medium type questions and last
level is hard type. The game instructions are given in the game. First
you have to deposit some amount as bet. Depending on the number
of right answers, amount will increase accordingly. This quiz game
also play a role to check your aptitude relating any subject. This
game doesnt contain any specific topic but have selected questions
from different subject. I tried to include questions from most of the
subject.

Page | 1

C++ Game Project

Header files and their purposes


#include<iostream.h>
This header file is included in every C++ programs to implement
intput/output facilities.
#include<conio.h>
This header file is include to clear the screen.
#include<dos.h>
This header file is included to delay the time of execution.
#include<stdio.h>
This header file is used in consoled input-output functions.
#include<process.h>
This header file is used when library functions are used.

Page | 2

C++ Game Project

Coding
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<stdio.h>
#include<process.h>
void main()
{
clrscr();
char b,y,Y,name[20];
int ch,a,amt,bal=0;
cout<<"\n\n\n\n\n\n\n\n\t\tWelcome to play quiz game";
cout<<"\n\n\n\n\n\n\n\n\n\t\t\tGame designed and developed
by\n\n\t\t\t\t\tShamla Abdul Jabbar";
getch();
clrscr();
menu:
cout<<"\n\n\n\n\n\t\t\t\t---------";
cout<<"\n\t\t\t\tMain menu";
cout<<"\n\t\t\t\t---------";
cout<<"\n\n\n\t\t1.Instructions\t\t\t2.Play\n\n\n\t\t\t\t3.Exit";
cout<<"\n\n\n\t\tEnter your choice:";
cin>>ch;
getch();
clrscr();
switch (ch)
{
case 1:

Page | 3

C++ Game Project


cout<<"\n\t\t\t\t============\n\t\t\t\tInstructions\n\t\t\t\t=
===========";
cout<<"\n\n\n1.First you've to enter some deposit amount.";
cout<<"\n\n2.The amount must be min.Rs.1000 and max.Rs.2000";
cout<<"\n\n3.For every correct answer Rs.100 would be
rewarded.";
cout<<"\n\n4.For every incorrect answer Rs.50 would be
detected.";
cout<<"\n\n5.At the end of any mode,computer will make a
decision";
cout<<" whether you enter the next level or not.";
cout<<"\n\n6.Rewarding increses by Rs.200 in level 2 and Rs.600
in level 3";
cout<<"\n\n\nPress * to goto main menu:";
cin>>b;
if(b=='*')
{
clrscr();
goto menu;
}
else
cout<<"Thank-you.Have a nice day!!!";
case 2:
clrscr();
cout<<"Enter your name:";
gets(name);
clrscr();
cout<<"\n\n\n"<<"Hi"<<" "<<name<<" ";
again:
cout<<"\n\n\nEnter your deposit amount(max:Rs.2000):";
cin>>amt;
if (amt<=2000)
Page | 4

C++ Game Project


goto start;
else
cout<<"\n\n\t\tSorry!Enter amont less than Rs.2000";
goto again;
getch();
clrscr();
start:
cout<<"\n\n\n\n\n\t\t\t\tLOADING......";
delay(600);
cout<<".......";
delay(300);
cout<<"..........";
delay(300);
clrscr();
cout<<"\n\n\n\n\n\n\tWelcome"<<" "<<name<<"!!!!";
getch();
clrscr();
cout<<"\n\t\t\tLEVEL 1";
level1:
cout<<"\n\n1.Who built the famous monument Tajmahal?";
cout<<"\n1.Mumtaz\t\t\t2.Shahjahan\n\t\t3.Akber\nEnter your
answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tcogratz!correct answer";
bal=amt+100;
}
else
{
cout<<"\n\n\t\tWrong answer!Better luck next time";
bal=amt-50;
Page | 5

C++ Game Project


}
getch();
clrscr();
cout<<"\n\n2.Who was the first Indian woman to join Indian
Police officer?";
cout<<"\n1.Arundhati Roy\t\t\t2.Sarojini Naidu\n\t\t3.Kiran
Bedi\nEnter your answer:";
cin>>a;
if (a==3)
{
cout<<"\n\n\t\tWell done!correct answer";
bal=amt+100;
}
else
{
cout<<"\n\n\t\tYou've got it wrong";
bal=amt-50;
}
getch();
clrscr();
cout<<"\n\n3.Which is the official residence of President of India
called?";
cout<<"\n1.Cliff House\t\t\t2.Rashtrapathi Bhavan\n\t\t3.Rashtra
Mandir\nEnter your answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tWonderful!You're a genius";
bal=amt+100;
}
else
{
Page | 6

C++ Game Project


cout<<"\n\n\t\tWrong answer";
bal=amt-50;
}
getch();
clrscr();
cout<<"\n\n4.Who is the author of Gitanjali?";
cout<<"\n1.Rabindranath Tagore\t\t\t2.Charles
Dickens\n\t\t3.Ravi Shankar\nEnter your answer:";
cin>>a;
if (a==1)
{
cout<<"\n\n\t\tCorrect answer!";
bal=amt+100;
}
else
{
cout<<"\n\n\t\tGot it wrong";
bal=amt-50;
}
getch();
clrscr();
cout<<"\n\n5.How many rings does an olympic flag has?";
cout<<"\n1)6\t\t\t2)5\n\t\t3)4\nEnter your answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tGood job!";
bal=amt+100;
}
else
{
cout<<"\n\n\t\tSorry!You've got it wrong";
Page | 7

C++ Game Project


bal=amt-50;
}
cout<<"\n\n\tYour current balance is"<<bal;
if (bal>=600)
goto level2;
else
{
clrscr();
cout<<"\n\n\n\t\t\tSorry"<<name<<"You don't have sufficient
balance to enter 2nd level!";
cout<<"\n\t\t\tYou won Rs."<<bal;
cout<<"\n\n\t___Thanks for playing.Hope you enjoyed___";
}
getch();
break;
level2:
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tCongratz!"<<name<<" "<<"You
reached 2nd level";
getch();
clrscr();
cout<<"\n\t\tLEVEL 2";
cout<<"\n\n1.Which disease is caused due to deficiency of
calcium?";
cout<<"\n1.Rickets\t\t\t2.Arthrits\n\t\t3.Allergy\nEnter your
answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tGood job!";
bal=amt+300;
}
Page | 8

C++ Game Project


else
{
cout<<"\n\n\t\twrong answer";
bal=amt-100;
}
getch();
clrscr();
cout<<"\n\n2.What is the other name for backbone?";
cout<<"\n1.Vertibrate\t\t\t2.Spine\n\t\t3.Chord\nEnter your
answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tWell done!";
bal=amt+300;
}
else
{
cout<<"\n\n\t\tYou've got it wrong";
bal=amt-100;
}
getch();
clrscr();
cout<<"\n\n3.What is a group of webpages called?";
cout<<"\n1.Website\t\t\t2.Webchart\n\t\t3.Webbook\nEnter
your answer:";
cin>>a;
if (a==1)
{
cout<<"\n\n\t\tCorrect answer!";
bal=amt+300;
}
Page | 9

C++ Game Project


else
{
cout<<"\n\n\t\tWrong answer";
bal=amt-100;
}
getch();
clrscr();
cout<<"\n\n4.In the story 'Pinochio',which body organ of Pinochio
deforms because of telling lies?";
cout<<"\n1.Ears\t\t\t2.Nose\n\t3.Tongue\nEnter your answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tMarvellous!Hope you read well";
bal=amt+300;
}
else
{
cout<<"\n\n\t\tGot it wrong.Must improve your reading habit";
bal=amt-100;
}
getch();
clrscr();
cout<<"\n\n5.Which animal was the first to travel in space?";
cout<<"\n1.Cat\t\t\t2.Elephant\n\t\t3.Dog\nEnter your answer:";
cin>>a;
if (a==3)
{
cout<<"\n\n\t\tWell done";
bal=amt+300;
}
else
Page | 10

C++ Game Project


{
cout<<"\n\n\t\tBetter luck next time";
bal=amt-100;
}
cout<<"\n\n\n\n\tYour current balance is"<<bal;
if (bal>=1500)
goto level3;
else
{
clrscr();
cout<<"\n\n\n\n\t\tYou don't have sufficient balance to enter
3rd level!";
cout<<"\n\t\tYou won Rs."<<bal;
cout<<"\n\n\t\t___Thanks for playing.Hope you enjoyed___";
}
getch();
break;
level3:
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tCongratz!"<<name<<" "<<",you
reached 3rd level!!";
getch();
clrscr();
cout<<"\t\t\tLEVEL 3";
cout<<"\n\n1.Who was the first Indian woman to become the
judge of Supreme Court?";
cout<<"\n1.Arundhathi Roy\t\t\t2.Fathima Beevi\n\t\t3.Kiran
Bedi\nEnter your answer:";
cin>>a;
if (a==2)
{
cout<<"\n\n\t\tAmazing!you've got it correct";
Page | 11

C++ Game Project


bal=amt+600;
}
else
{
cout<<"\n\n\t\tOops!Wrong answer";
bal=amt-200;
}
getch();
clrscr();
cout<<"\n\n2.Which scientist was known for his theory of light
refraction and optics?";
cout<<"\n1.Gallileo\t\t\t2.Aryabhatta\n\t\t3.C.V Raman\nEnter
your answer:";
cin>>a;
if (a==3)
{
cout<<"\n\n\t\tFantastic!Correct answer";
bal=amt+600;
}
else
{
cout<<"\n\n\t\tOops!Wrong answer";
bal=amt-200;
}
getch();
clrscr();
cout<<"\n\n3.Name the only woman who ruled Delhi?";
cout<<"\n1.Razia Sultan\t\t\t2.Rani Laxmi Bhai\n\t\t3.Mumtaz
Rani\nEnter your answer:";
cin>>a;
if (a==1)
{
Page | 12

C++ Game Project


cout<<"Well done!correct answer";
bal=amt+600;
}
else
{
cout<<"You've got it wrong";
bal=amt-200;
}
getch();
clrscr();
cout<<"\n\n4.What is the inner layer of the skin called?";
cout<<"\n1.Dermis\t\t\t2.Epidermis\n\t\t3.Keratin\nEnter your
answer:";
cin>>a;
if (a==1)
{
cout<<"\n\n\t\tGood Job!Correct answer";
bal=amt+600;
}
else
{
cout<<"\n\n\t\tBetter Luck next time";
bal=amt-200;
}
getch();
clrscr();
cout<<"\n\n5.Which Indian lady was nicknamed as Payyoli
Express?";
cout<<"\n1.Tintu Luka\t\t\t2.Radha s\n\t\t3.P.T Usha\nEnter
your answer:";
cin>>a;
if (a==3)
Page | 13

C++ Game Project


{
cout<<"\n\n\t\tFantastic!well answered!!!";
bal=amt+600;
}
else
{
cout<<"\n\n\t\tOops!wrong answer";
bal=amt-200;
}
clrscr();
cout<<"\n\n\n\n\n\n\tCongratulations!!!"<<name<<"You won
Rs."<<bal;
cout<<"\n\n\t___Thanks for playing.Hope you enjoyed___";
getch();
clrscr();
cout<<"\n\nDo you want to play again(y/n)?:";
cin>>a;
if (c==y||c==Y)
{
clrscr();
goto level1;
}
else
goto exit;
break;
case 3:
clrscr();
exit:
cout<<"\n\n\n\n\n\n\t\t*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*";
cout<<"\n\t\t\tTHANK YOU.HAVE A NICE DAY";
cout<<"\n\t\t*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*";
break;
Page | 14

C++ Game Project


default:
cout<<"You've entered a wrong choice!!";
break;
getch();
return;
}
}

Page | 15

C++ Game Project

Output Screen
Welcome to play quiz game
Game designed and developed by
Shamla Abdul Jabbar
--------------Main menu
---------------1. Instructions
2.Play
3. Exit
Enter your choice: 1
============
Instructions
============
1. First you've to enter some deposit amount.
2. The amount must be min.Rs.1000 and max.Rs.2000
3. For every correct answer Rs.100 would be rewarded.
4. For every incorrect answer Rs.50 would be detected.
5. At the end of any mode, computer will make a decision
whether you enter the next
level or not.
Page | 16

C++ Game Project

6. Rewarding increses by Rs.200 in level 2 and Rs.600 in


level 3
Press * to goto main menu:*

--------------Main menu
--------------1 .Instructions
2.Play
3. Exit
Enter your choice: 2

Enter your name: Shamla


Hi Shamla
Enter your deposit amount(max:Rs.2000):2000
Loading.......................................
Welcome Shamla!!!!

Page | 17

C++ Game Project

LEVEL 1
1. Who built the famous monument Tajmahal?
1. Mumtaz
2.Shahjahan
3.Akber
Enter your answer: 2
cogratz!correct answer
2. Who was the first Indian woman to join Indian Police
officer?
1. Arundhati Roy
2.Sarojini Naidu
3. Kiran Bedi
Enter your answer: 3
Well done!correct answer
3. Which is the official residence of President of India called?
1. Cliff House
2.Rashtrapathi Bhavan
3. Rashtra Mandir
Enter your answer: 2
Wonderful!You're a genius
4. Who is the author of Gitanjali?
1. Rabindranath Tagore
2.Charles Dickens
3. Ravi Shankar
Enter your answer: 1
Page | 18

C++ Game Project

Correct answer!
5. How many rings does an olympic flag has?
1)6
2)5
3)4
Enter your answer: 2
Congratz!Shamla You reached 2nd level
LEVEL 2
1. Which disease is caused due to deficiency of calcium?
1. Rickets
2.Arthrits
3. Allergy
Enter your answer: 2
Good job!
2.What is the other name for backbone?
1.Vertibrate
2.Spine
3.Chord
Enter your answer:2
Well done!
Page | 19

C++ Game Project

3. What is a group of webpages called?


1. Website
2.Webchart
3. Webbook
Enter your answer:1
Correct answer!
4. In the story 'Pinochio',which body organ of Pinochio
deforms because of telling lies?
1. Ears
2.Nose
3. Tongue
Enter your answer: 2
Marvellous!Hope you read well
5.Which animal was the first to travel in space?
1.Cat
2.Elephant
3.Dog
Enter your answer:1
Congratz!Shamla ,you reached 3rd level!!
LEVEL 3
1.Who was the first Indian woman to become the judge of
Supreme Court?
Page | 20

C++ Game Project

1.Arundhathi Roy
3.Kiran Bedi
Enter your answer:2

2.Fathima Beevi

Amazing!you've got it correct


2.Which scientist was known for his theory of light
refraction and optics?
1.Gallileo
2.Aryabhatta
3.C.V Raman
Enter your answer:3
Fantastic!Correct answer
3.Name the only woman who ruled Delhi?
1.Razia Sultan
2.Rani Laxmi Bhai
3.Mumtaz Rani
Enter your answer:1
Well done!correct answer
4.What is the inner layer of the skin called?
1.Dermis
2.Epidermis
3.Keratin
Enter your answer:1

Page | 21

C++ Game Project

Good Job!Correct answer


5.Which Indian lady was nicknamed as Payyoli Express?
1.Tintu Luka
2.Radha s
3.P.T Usha
Enter your answer:3
Congratulations!!!ShamlaYou won Rs.2600
Thanks for playing.Hope you enjoyed
Do you want to play again(y/n)?: n
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*
THANK YOU.HAVE A NICE DAY
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*

Page | 22

C++ Game Project

Requirements

Page | 23

C++ Game Project

Bibliography
Computer science with C++
Textbook XI by Sumita Arora

Page | 24