You are on page 1of 30

MAHARASHTRA STATE BOARD OF

TECHNICALEDUCATION
K.V.N.NAIK S.P.SANSTHA’S POLYTECHNIC
NASHIK-422 002
MICRO PROJECT REPORT
Academic year: 2019-20

QUIZE GAME

Program: CO Program code: CO3I


Course: Object Oriented Programming using C++
Course Code: 22316
CERTIFICATE
This is to certify that Mr. Aditya Sanjay Hire Roll No.46 Of First Semester of
Diploma in Computer Engineering of Institute, K. V. N. NAIK
POLYTECHNIC, NASHIK (Code: 1477) has completed the Micro Project
satisfactorily in Subject:- Object Oriented Programming Using C++ for the Academic
Year 2019- 2020 as prescribed in the curriculum.
Place: Nashik Enrollment no:1914770173
Date: …………. Exam seat no: ……………

Subject Teacher Head of Department Principal

Seal of institute
INDEX

Chap .no Content Page


No.
1 Acknowledgement -
1
2 Introduction Quize Game

3 History Of Turbo C++ 3

4 System specification 4

5 Project Description 5

6 Advantages and Disadvantages 6

7 Code of Hotel Quize Game 7


8 Output 21

9 Conclusion 28
WEEKLY PROGRESS REPORT
MICRO PROJECT

SR.NO. WEEK ACTIVITY DATE SIGN OF


PERFORMED GUIDE
Discussion and
1 1st
finalization of topic
Preparation and
2 2nd
submission of Abstract
3 3rd Literature Review

4 4th and 5th Collection of Data

5 6th and 7th Collection of Data


Discussion and outline of
6 8th and 9th Content

7 10th Formulation of Content


Editing and proof
11th and
8 Reading of
12th
Content
Compilation of Report
9 13th
And Presentation

10 14th Seminar

11 15th Viva voce


Final submission of Micro
12 16th
Project

Sign of the student Sign of the faculty


ACKNOWLEDGEMENT
 I am very thanking full to K.V.N.NAIK Polytechnic who has given me
opportunity to have project knowledge of Professional practices.
 I am also thankful to the means for providing me the information of Professional
Practices which is the base of the Project.
 Lastly I am thankful to my subject teacher for proper guidance and co-operative
in preparation of the project work.
ANEEXURE II
Evaluation Sheet for the Micro Project
Academic Year :2019-2020 Name of the Faculty: Prof.S.G.BODKE
Sub: Object Oriented Programing Using C++ Course Code: CO3I
Semester: III
Title of the project: Quize Game
Cos addressed by Micro Project:
A. Develop C++ Program to solve problems using procedure-oriented approach.
B. Develop C++ Program using classes and objects.
C. Develop C++ Program to perform file operations.
Major learning outcomes achieved by students by doing the project
(a) Practical outcome:
1. Develop programs that implement a class and use it with object.
2. Write a program to read and write data to and from a file.
(b) Unit outcomes in Cognitive domain:
1. Write/ compile/debug/execute C++ Program using classes, externally define function.

(c)Outcomes in Affective domain:


1. Follows safety practices.
2. Follow Ethics.
3. Practice Good Housekeeping.

Comments/suggestions about team work /leadership/inter-personal communication (if any)


……………………………………………………………………………………………………..

Marks out of (6) Marks out of (4)


Roll Student Name for performance for performance Total
No in group activity in oral/ out
(D5 Col.8) presentation of
(D5 Col.9) (10)
46 Aditya Sanjay Hire

Prof. S.G.Bodke
(Signature of Faculty)
Project Content

Defination :-
In this QUIZ GAME we have to answer some exiting questions Then we will get the
result.

INTRODUCTION

The Project “Quiz Game” has been developed as a very understandable Database of
Questions that can be created and handled easily. When you add any question to the
Database, the serial number has been assigned to it automatically and settled in the
binary file named as Questions. Generally the Database is being a Master file that
possesses the tabular format of Quiz, the Sub menu for the subjects like Computer or
Mathematics or Science or General studies and Menu option Return.

The software is used on the basis of the Questions asked to the user that belongs to the
Menu topics and the user gets only 10 seconds to answer. The Quiz goes like this, the
user has to answer the question and if the user is right he or she gains 10 points and if
question attempt goes wrong the Quiz will stop and closed.

The Project aimed to create a easy Database which can be handled and created easily.
The Quiz Game is made by considering the interest of the customer in mind. The
Reports is made according to the customers presence on the Quiz and payment for the
Quiz has to be paid by the customer
History Of Turbo C++

The C++ programming language has a history going back to 1979, when Bjarne
Structure was doing work for his Ph.D. thesis. He began work on "C with Classes",
which as the name implies was meant to be a superset of the C language. His goal was
to add object-oriented programming into the C language, which was and still is a
language well-respected for its portability without sacrificing speed or low-level
functionality.

His language included classes, basic inheritance, inline, default function arguments, and
strong type checking in addition to all the features of the C language. The first C with
Classes compiler was called c Front, which was derived from a C compiler called CPre.
It was a program designed to translate C with Classes code to ordinary C.

In 1983, the name of the language was changed from C with Classes to C++. The ++
operator in the C language is an operator for incrementing a variable, which gives some
insight into how Structure regarded the language. Many new features were added around
this time, the most

notable of which are virtual functions, function overloading, references with the &
symbol, the const keyword, and single-line comments using two forward slashes.

In 1985, C++ was implemented as a commercial product. The language was not
officially standardized yet. The language was updated again in 1989 to include protected
and static members, as well as an inheritance from several classes.
In 1990, Turbo C++ was released as a commercial product. Turbo C++ added a lot of
additional libraries which have had a considerable impact on C++'s development.

In 1998, the C++ standards committee published the first international standard for C++
ISO/IEC 14882:1998, which is informally known as C++98. The Standard Template
Library, which began its conceptual development in 1979, was also included. In 2003,
the committee responded to multiple problems that were reported with their 1998
standard and revised it accordingly. The changed language was named C++03.

In mid-2011, the new C++ standard (C++11) was finished. The new features included
Regex support, a randomization library, a new C++ time library, atomics support, a
standard threading library, a new for loop syntax providing functionality similar to for
each loops in certain other languages, the auto keyword, new container classes, better
support for unions and array-initialization lists and variadic templates.
System specification

1.Hardware Requirement (Minimum Requirement)

 Minimum RAM:4GB
 Hard Disk:-128 GB
 Processor: intel Pentium 4(1.50GHZ) or above

2.Software Requirement (Minimum Requirement)

 Operating system: Windows 10 pro


 Front end language: Turbo C++ version 3.0
Function

1) The purpose of the game is to entertain Player by playing this game, return the
result. The Facility to choose the count of player is given.
2) This game also have the facility to display same score of player an d according
to score we also display the wining player’s name.
3) Here we have used two classes Student and question which are inherited by
single inheritance.
4) In student class it will accept the name of Player by using accept function and
welcome them by using display function.
5) We have use function like
a) void accept() : To accept the name of player.
b) void display() : To welcome the Player.
c) void quiz() : To display the question question and accept correct choice
from player and count the score.
d) void count() : To display the counted score.

A. CLASS
i. Collection of member variable and member function.
ii. It also includes objects.
iii. Classes are user defined datatype.
iv. Objects are variables of type class.

B.INHERITANCE
1. The mechanism of deriving a new class from old class is called as
Inheritance.
2. The object of one class can acquire the property of another class is
called as Inheritance.
3. The old class is referred as base class or super class. New class is
referred as derived class or sub class.

4. There are various types of inheritance namely


i. Single inheritance
ii. Multilevel Inheritance
iii. Multiple Inheritance
iv. Hierarchical Inheritance
v. Hybrid Inheritance
5. In single inheritance, Only one base class and one derived class.

Coding with comments


#include<iostream.h>
#include<conio.h>
class student //base class
{
public:
char name[10];
void accept()
{
cout<<"Enter your Name :";
cin>>name;
cout<<endl;
}
void display()
{
cout<<"\n\n\t\t\t\tWelcome "<<name;
}
};
class question:public student //derived class
{
public:
char ch;
int score;
void quiz()
{
score=0;
cout<<"\nQ.1 Which of the following is not a type of constructor
?";
cout<<"\n A) Copy constructor\t\t B) Friend constructor\n C)
Default constructor \tD) Parameterized constructor\n";
cin>>ch;
if(ch=='b'||ch=='B')
{
score++;
}
cout<<"\nQ.2 cout is an _____";
cout<<"\n A] operator\t B) function\n C) macro\t D) object\n";
cin>>ch;
if(ch=='d'||ch=='D')
{
score++;

cout<<"\nQ.3 Which of the following approach is adapted by


c++?";

cout<<"\n A) Top-down\t B) Bottom-up\n C) Right-left\t D) Left-right\n";


cin>>ch;
if(ch=='b'||ch=='B')
{
score++;
}

cout<<"\nQ.4 Which loop needs semi colon after?";


cout<<"\n A) for\t B) do\n C) while\t D)none of above\n";
cin>>ch;
if(ch=='b'||ch=='B')
{
score++;
}

cout<<"\nQ.5 Where does keyword friend should be placed?";


cout<<"\n A) function declaration\t B) function defination\n C)
main function\t D) none of above\n";
cin>>ch;
if(ch=='a'||ch=='A')
{
score++;
}

cout<<"Q.6 Which of the following is a valid inline for fuction


add()"<<endl;
cout<<" A) void add() inlile\n B) inline void add()\n C) Both A and
B\n D) None of above\n";
cin>>ch;
if(ch=='b' || ch=='B')
{
score++;
}

cout<<"
Q.7 A derived class with only one base class is called______ inheritance."<<endl;
cout<<" A) single\t B) multiple\n C) multilevel\t D)hierarchical\n";
cin>>ch;
if(ch=='a' || ch=='A')

{
score++;
}

cout<<"
Q.8 The derivation of child class from base class is indicated by______
symbol."<<endl;
cout<<" A} :: \t B) ;\n C) :\t D) | \n";
cin>>ch;
if(ch=='c' || ch=='C')
{
score++;
}

cout<<"Q.9 In_____ inheritance, the constructor are executed in the


order of inheritance."<<endl;
cout<<" A) multipath\t B) multiple\n C) multilevel\t D)
hierachical\n";
cin>>ch;
if(ch=='c' || ch=='C')
{
score++;
}

cout<<"Q.10 Which of following is not member of class"<<endl;


cout<<" A) static function \t B) friend function \n C) const
function\t D) virtual function\n";
cin>>ch;
if(ch=='B' || ch=='b')
{
score++;
}
}
void count()
{
cout<<"YOUR SCORE = "<<score;
}
};
void main()
{
intn,a;
clrscr();

cout<<"**********************************QUIZ
GAME*************************************\n";

cout<<"Rules of Game:"<<endl;
cout<<"1) First Enter the Player count."<<endl;
cout<<"2) Answer the 10 questions."<<endl;
cout<<"3) Each question have 4 options."<<endl;

cout<<"4) Please enter valid choise otherwise your marks will be not calculated
for that question."<<endl;
cout<<"5) Each question has 1 mark."<<endl;
cout<<"6) After all questions your score will appear on screen."<<endl;
cout<<"7) And at last your result will be displayed."<<endl;

cout<<endl<<endl<<endl;
cout<<"*********************************ALL THE
BEST***********************************"<<endl;
cout<<"Press ENTER->";
getch();
clrscr();

cout<<"Enter the player No:\n";


cout<<" 1) 1 player\n 2) 2 Player\n 3) 3 Player\n 4) 4 player\n";
cin>>n;
cout<<"\n********************************************************
**********************\n";
if(n<=4)
{
question Q[4];
for(inti=0;i<n;i++)
{
cout<<"Player "<<i+1<<endl;
Q[i].accept(); //accepting name of player
}
cout<<"\n********************************************************
**********************";
for(i=0;i<n;i++)
{

Q[i].display(); //welcoming player


cout<<endl;
}
cout<<"\n********************************************************
**********************\n";
cout<<"Press ENTER->";
getch();

clrscr();

for(i=0;i<n;i++)
{
cout<<"Questions for "<<Q[i].name<<endl;

cout<<"\n********************************************************
**********************\n";
Q[i].quiz(); //Displaying question
cout<<endl;
Q[i].count(); //Displaying score
cout<<endl<<"Press ENTER->";
getch();
clrscr();
}
if(n>1)
{
for(i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
if(Q[i].score==Q[j].score)
{
a=1;

cout<<"\n********************************************************
**********************\n";
cout<<"\t\t\t\t";
cout<<Q[i].name<<" and "<<Q[j].name<<" have same
marks"<<endl;

cout<<"\n********************************************************
**********************\n";
}
}
}
if(a!=1)
{
for(i=0;i<n;i++)
{
if(Q[0].score<Q[i].score)
{
Q[0]=Q[i];
}

cout<<"\n********************************************************
**********************\n\n";
cout<<endl<<"\t\t\t\t"<<Q[0].name<<" WON"<<endl;

cout<<"\n********************************************************
**********************\n";
}
}
else
if(n==1)
{
for(i=0;i<n;i++)
{
if(Q[i].score==10 || Q[i].score>8)
{
cout<<"\nYou played EXCELLENT\n";
}
else
if(Q[i].score<8 || Q[i].score>6)
{
cout<<"\nYou played GOOD\n";
}
else
if(Q[i].score<6 || Q[i].score>4)
{
cout<<"\nYou played NICE\n";
}
if(Q[i].score<4)
{
cout<<"\nYou played POOR\n";
}
}
}
}
getch();
}

OUTPUT
**********************************QUIZ
GAME*************************************
Rules of Game:
1) First Enter the Player count.
2) Answer the 10 questions.
3) Each question have 4 options.
4) Please enter valid choise otherwise your marks will be not calculated for tha
t question.
5) Each question has 1 mark.
6) After all questions your score will appear on screen.
7) And at last your result will be displayed.

*********************************ALL THE
BEST***********************************

Press ENTER->

Enter the player No:


1) 1 player
2) 2 Player
3) 3 Player
4) 4 player
1

****************************************************************
**************
Player 1
Enter your Name : Aditya

Player 2
Enter your Name : Ritikesh

Player 3
Enter your Name : Abhishek

Player 4
Enter your Nmae : Ritik

****************************************************************
**************
Welcome :- Aditya

****************************************************************
**************

Press ENTER->

Questions for Aditya

****************************************************************
**************

Q.1 Which of the following is not a type of constructor ?

A) Copy constructor B) Friend constructor


C) Default constructor D) Parameterized constructor
Ans :- B

Q.2 cout is an _____

A] operator B) function
C) macro D) object
Ans:- D

Q.3 Which of the following approach is adapted by c++?

A) Top-down B) Bottom-up
C) Right-left D) Left-right
Ans:- B

Q.4 Which loop needs semi colon after?

A) for B) do
C) while D)none of above
Ans:- B

Q.5 Where does keyword friend should be placed?

A) function declaration B) function defination

C) main function D) none of above


Ans:- D
Q.6 Which of the following is a valid inline for fuction add()

A) void add() inlile C) Both A and B


B) inline void add() D) None of Above
Ans:- B

Q.7 A derived class with only one base class is called______ inheritance.

A) single B) multiple
C) multilevel D)hierarchical
Ans:-A

Q.8 The derivation of child class from base class is indicated by______ symbol.

A} :: B) ;
C) : D) |
Ans:- C

Q.9 In_____ inheritance, the constructor are executed in the order of inheritanc
e.

A) multipath B) multiple
C) multilevel D) hierachical
Ans:- C

Q.10 Which of following is not member of class

A) static function B) friend function


C) const function D) virtual function
Ans:- D

YOUR SCORE = 9
Press ENTER->

You played EXCELLENT


****************************************************************
**************
Welcome :- Ritikesh

****************************************************************
**************
Press ENTER->

Questions for ritikesh

****************************************************************
**************

Q.1 Which of the following is not a type of constructor ?

A) Copy constructor B) Friend constructor


C) Default constructor D) Parameterized constructor
Ans:-B

Q.2 cout is an _____

A] operator B) function
C) macro D) object
Ans:- D

Q.3 Which of the following approach is adapted by c++?

A) Top-down B) Bottom-up
C) Right-left D) Left-right
Ans:- B

Q.4 Which loop needs semi colon after?

A) for B) do
C) while D)none of above
Ans:- C

Q.5 Where does keyword friend should be placed?

A) function declaration B) function defination


C) main function D) none of above
Ans:- B
Q.6 Which of the following is a valid inline for fuction add()

A) void add() inlile


B) inline void add()
C) Both A and B
D) None of above
Ans:- B

Q.7 A derived class with only one base class is called______ inheritance.

A) single B) multiple
C) multilevel D)hierarchical
Ans:- B

Q.8 The derivation of child class from base class is indicated by______ symbol.

A} :: B) ;
C) : D) |
Ans- B

Q.9 In_____ inheritance, the constructor are executed in the order of inheritanc
e.

A) multipath B) multiple
C) multilevel D) hierachical
AnS;-C

Q.10 Which of following is not member of class

A) static function B) friend function


C) const function D) virtual function
Ans:-B

YOUR SCORE = 8
Press ENTER->
****************************************************************
*************

Welcome :- Abhishek

****************************************************************
**************

Question for Abhishek

Q.1 Which of the following is not a type of constructor ?

A) Copy constructor B) Friend constructor


C) Default constructor D) Parameterized constructor
Ans:-B

Q.2 cout is an _____

A] operator B) function
C) macro D) object
Ans:-D

Q.3 Which of the following approach is adapted by c++?

A) Top-down B) Bottom-up
C) Right-left D) Left-right
Ans:-B

Q.4 Which loop needs semi colon after?

A) for B) do
C) while D)none of above
Ans:-C

Q.5 Where does keyword friend should be placed?

A) function declaration B) function defination


C) main function D) none of above
Ans:- B

Q.6 Which of the following is a valid inline for fuction add()

A) void add() inlile


B) inline void add()
C) Both A and B
D) None of above
Ans:-B

Q.7 A derived class with only one base class is called______ inheritance.

A) single B) multiple
C) multilevel D)hierarchical
Ans:-A

Q.8 The derivation of child class from base class is indicated by______ symbol.

A} :: B) ;
C) : D) |
Ans:-C

Q.9 In_____ inheritance, the constructor are executed in the order of inheritanc
e.

A) multipath B) multiple
C) multilevel D) hierachical
Ans:-C

Q.10 Which of following is not member of class

A) static function B) friend function


C) const function D) virtual function
Ans:-B

YOUR SCORE = 9
Press ENTER->
****************************************************************
**************
Welcome Ritik

****************************************************************
**************

Questions for ritik

Q.1 Which of the following is not a type of constructor ?

A) Copy constructor B) Friend constructor


C) Default constructor D) Parameterized constructor
Ans:-B

Q.2 cout is an _____

A] operator B) function
C) macro D) object

Ans:- D

Q.3 Which of the following approach is adapted by c++?

A) Top-down B) Bottom-up
C) Right-left D) Left-right
Ans:-B

Q.4 Which loop needs semi colon after?

A) for B) do
C) while D)none of above
Ans:-C

Q.5 Where does keyword friend should be placed?

A) function declaration B) function defination


C) main function D) none of above
Ans:-C

Q.6 Which of the following is a valid inline for fuction add()

A) void add() inlile


B) inline void add()
C) Both A and B
D) None of above
Ans:-B

Q.7 A derived class with only one base class is called______ inheritance.

A) single B) multiple
C) multilevel D)hierarchical
Ans;-A

Q.8 The derivation of child class from base class is indicated by______ symbol.

A} :: B) ;
C) : D) |
Ans:-C

Q.9 In_____ inheritance, the constructor are executed in the order of inheritanc
e.

A) multipath B) multiple

C) multilevel D) hierachical
Ans:-C

Q.10 Which of following is not member of class

A) static function B) friend function


C) const function D) virtual function
Ans:-C

YOUR SCORE = 10
Press ENTER->

****************************************************************
**************
Ritik WON

**********************************************************************
*******

Conclusion

This chapter provided an important overview of the technologies available to make


game development a simpler process. It illustrated the importance of libraries to the
world of game development and explored how developers use pre-existing code and
libraries to do a lot of hard work for them so they can concentrate on making the game
rather than all its structures. In this sense, then, libraries can be seen as the foundation
for a game, and it remains for programmers to assemble them together and make them
work in unison.

We'll discuss the process of using these libraries to make games in the next chapter,
which explores ClanLib and 2D games.
References:
1. https://www.programiz.com/cpp-programming/inheritance
2. https://www.geeksforgeeks.org/c-plus-plus-gq/inheritance-gq/
3. https://www.tutorialspoint.com/cplusplus/cpp_arrays.html

You might also like