Quiz Mini Project
Quiz Mini Project
BACHELOR OF ENGINEERING
In
Submitted by:
MANASA R (1SG19CS056)
MANDHARA B G (1SG19CS057)
PROF. PRAKRUTHI C
Assistant Professor
BENGALURU 560057
CERTIFICATE
Certified that the Mini Project Work entitled “QUIZ GAME” carried out by MANASA R
and MANDHARA B G, bonafide students of Sapthagiri College of Engineering, in partial
fulfilment for the award of Bachelor of Engineering degree in Computer science and
Engineering during academic year 2020-2021. It is certified that all corrections/suggestions
indicated for Internal Assessment have been incorporated in the report deposited in the
department library
The satisfaction that accompanies the successful completion of this project would be
incomplete without the mention of the people who made it possible, without whose constant
guidance and encouragement would have made efforts go in vain. It’s our privilege to express
gratitude and respect towards all those who guided us through the completion of this project.
We would like to express our immense gratitude to Dr. H Ramakrishna, Principal, for
his help and inspiration during the tenure of the course.
We would like to extend our sincere thanks to Dr. Kamalakshi Naganna, Professor
and Head, Department of Computer Science & Engineering, for her constant support.
We would like to express our deep gratitude and most sincere thanks to our project
guide, Prof. Prakruthi C, Assistant Professor, Department of CSE for giving the most valuable
suggestion, helpful guidance, constant support and encouragement in the execution of this
project work.
We are also thankful to all the Faculty members and supporting staff, Department of
CSE, for their constant support and encouragement.
Finally, we thank our parents and friends for their moral support.
ABSTRACT
The concept of quiz is currently very popular among educated circles as well as in
entertainment shows. Though the quiz can be conducted manually, it often needs elaborate
preparations. Quiz contributes to the growth of knowledge of an individual and they are a
popular source of entertainment.
This quiz game focuses on creating interactive quiz possibly with a question on
various topics. This quiz game is designed to increase learning of players by playing multiple
choice questions which are interactive, user friendly and fun to play.
CONTENTS
1. INTRODUCTION 01
2. SYSTEM REQUIREMENTS 03
3. DESIGN 04
4. IMPLEMENTATION 07
5. RESULTS 25
6. CONCLUSION 28
7. BIBLIOGRAPHY 29
LIST OF FIGURES
Earlier Quiz Game was conducted manually in which there used to be a Quiz Master
asking questions with a book which was neither flexible nor friendly. So an automated Quiz
Game is designed to play quiz game in a more interactive and fun way which is flexible and
more reliable
1.1 BACKGROUND
The whole project is designed in ‘C’ language and different variables and
strings have been used for the development of this project. It is easy to operate and understand
by users. There is no any error and warning contents in the project. The design is so simple that
users won’t find it difficult to use and navigate.
1.2 OBJECTIVE
Page | 1
to give the input to start the quiz in the main menu and then they have to register by entering
the user name. Then the rules and regulations for playing the quiz will be displayed. Quiz is
started by displaying one question after the other with the four options. If the answer is correct,
the score gets incremented by +5 points and if wrong, no points will be reduced. Instead
displays the correct answer. Once all the questions are answered, final score will be displayed
on the screen. User can also check the highest score and even their ranking too .
Page | 2
2. SYSTEM REQUIREMENTS
C compiler software
RAM : 1 GB or more
Page | 3
3. DESIGN
2. The proposed system is highly error and mistake proof as no information has to be
entered manually.
4. The proposed system is designed with the below respective modules i.e.,
Page | 4
3.2 MODULE DESIGN
3.2.1 REGISTRATION
The user first has to register the name before the user starts to play the quiz
game.
As soon as the user chooses the quiz game menu strip the questions with 4
choices will be displayed and the user needs to select any one of the choices. Then the question
would be evaluated, if the answer is right the points get incremented by 5 and if it is wrong
then the right answer would be displayed and no points would be reduced. In such a manner
the next series of questions would be displayed till the end of the questions. Finally, the user’s
points will be displayed.
3.2.3 SCORE
This displays the scores of all the users who have played this quiz. In this
3.2.4 HELP
This displays the rules and regulations of the quiz game which has to be
followed by the user while playing the game.
3.2.5 EXIT
This strip displays two options for the user one to exit from the game and
one more to repeat the game.
Page | 5
Fig: 3.2 Use Case diagram for the Quiz Game
Page | 6
4. IMPLEMENTATION
4.1 SOURCE CODE
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct play {
char name[20];
int score;
int rat; //star ratings
}p;
void high_score();
void start();
void help();
int main()
{
clrscr();
int chc=0;
printf("****************Welcome to Quiz
Game**************************************************************");
printf("\nRegister your name:\n");
scanf("%s",p.name);
printf("\tMain Menu\n1 Start the game\n2 See high scores \n3 Game help\n4 Exit");
scanf("%d",&chc);
switch(chc)
{
case 1:
printf("**********Welcome \" %s \" to C Quiz Game **********\n\n", p.name);
Page | 7
printf("\n\n *************Rules to start the game**************");
printf("\n -------------------------------------------------------------------------");
printf("\n ......................Quiz Game...........\n");
printf("\n >> There will be a total of 20 questions");
printf("\n >> You will be given 4 options and you have to press 1, 2 ,3 or 4 for the");
printf("\n right option");
printf("\n >> Each question will carry 5 points");
printf("\n >> You will be asked questions continuously.");
printf("\n >> There is no negative marking for wrong answer");
start();
break;
case 2:
high_score();
break;
case 3:
help();
break;
case 4:
exit(1);
break;
default:
printf("\nInvalid input");
}
getch();
Page | 8
return 0;
}
void help()
{
int ch;
if(ch==1)
{
start();
}
else
{
exit();
}
}
Page | 9
void start()
{
int ans;
int count=0;
char rating[20];
FILE *fp;
if((fp=fopen("\\tmp\play2.txt","a"))==NULL)
{
printf("error opening file\n");
}
printf("Q(1).Grand Central Terminal, Park Avenue, New York is the world's \n 1.largest
railway station \t\t2.highest railway station\n 3.longest railway station\t\t 4.None of the
above\n\n");
if(ans==1)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 1.largest railway station\n\n");
}
if(ans==2)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 2.Insects\n\n");
}
printf("Q(3) Eritrea, which became the 182nd member of the UN in 1993, is in the
continent of \n1.Asia\t\t2.Africa\n3.Europe\t4.Australia\n\n");
if(ans==2)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 2.Africa\n\n");
}
Page | 11
printf("Q(4).Garampani sanctuary is located at \n1.Junagarh, Gujarat\t2.Diphu,
Assam\n3.Kohima, Nagaland\t4.Gangtok, Sikkim\n\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==2)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 2.Diphu, Assam\n\n");
}
++count;
}
else
{
printf("Wrong answer! Correct answer is 4.All of the above\n\n");
}
++count;
}
else
{
printf("Wrong answer! Correct answer is 2.Nazi Party\n\n");
}
++count;
}
else
{
printf("Wrong answer! Correct answer is 2.Film Finance Corporation\n\n");
}
printf("Q(8). Fastest shorthand writer was \n1.Dr. G. D. Bist\t2. J.R.D. Tata\n3. J.M.
Tagore\t4. Khudadad Khan\n\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==1)
{
printf("Correct! +5 points\n\n");
Page | 13
++count;
}
else
{
printf("Wrong answer! Correct answer is 1.Dr. G. D. Bist\n\n");
}
++count;
}
else
{
printf("Wrong answer! Correct answer is 1.Horse racing\n\n");
}
printf("Q(10). First human heart transplant operation conducted by Dr. Christian Bernard
on Louis Washkansky, was conducted in \n1.1967\t2.1968\n3.1958\t4.1922\n\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==1)
{
printf("Correct! +5 points\n\n");
++count;
}
else
Page | 14
{
printf("Wrong answer! Correct answer is 1. 1967\n\n");
}
printf("Q(11). Frames from one LAN can be transmitted to another LAN via the device
\n1. Router\t2. Bridge\n3. Repeater\t4. Modem\n\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==2)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 2. Bridge\n\n");
}
printf("Q(12). Which of the following conditions is used to transmit two packets over a
medium at the same time?\n1. Contention\t2. Collision\n3. Synchronous\tD.
Asynchronous\n\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==2)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 2. Collision\n\n");
}
Page | 15
printf("Q(13). What are the most commonly used transmission speeds in BPS used in data
communication?\n1. 300\t2. 1200\n3. 2400\t4. 9600\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==4)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 4. 9600\n\n");
}
++count;
}
else
{
printf("Wrong answer! Correct answer is 1.modem\n\n");
}
++count;
}
else
{
printf("Wrong answer! Correct answer is 3. the condition when two or more stations
attempt to use the same channel at the same time\n\n");
}
printf("Q(16). When you ping the loopback address, a packet is sent where?\n1. On the
network\n2. Down through the layers of the IP architecture and then up the layers again\n3.
Across the wire\n4. through the loopback dongle\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==2)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 2. Down through the layers of the IP
architecture and then up the layers again\n\n");
}
Page | 17
printf("Q(17). Which of the following TCP/IP protocols is used for transferring electronic
mail messages from one machine to another?\n1. FTP\t2. SNMP\n3. SMTP\t4. RPC\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==3)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 3. SMTP\n\n");
}
printf("Q(18). Which of the following devices is used to connect two systems, especially
if the systems use different protocols?\n1. hub\t2. bridge\n3. gateway\t4. repeater\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==3)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 3. gateway\n\n");
}
printf("Q(19). The slowest transmission speeds are those of\n1. twisted-pair wire\t2.
coaxial cable\n3. fiber-optic cable\t4. microwaves\n");
printf("Your answer: ");
scanf("%d",& ans);
Page | 18
if(ans==1)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 1. twisted-pair wire\n\n");
}
printf("Q(20). What is the port number for NNTP?\n1. 119\t2. 80\n3. 79\t4. 70\n");
printf("Your answer: ");
scanf("%d",& ans);
if(ans==1)
{
printf("Correct! +5 points\n\n");
++count;
}
else
{
printf("Wrong answer! Correct answer is 1. 119 \n\n");
}
p.score=count*5;
//writing to file
void high_score()
{
int ch;
FILE *fp;
if((fp=fopen("\\tmp\play2.txt", "r"))==NULL)
{
//printf("error opening file\n");
printf("\nNo games played yet!\n");
}
else
{
fclose(fp);
}
printf("\nContinue playing ? (1 - Yes and 0 - No) : ");
scanf("%d",&ch);
if(ch==1)
{
start();
}
else
{
exit();
}
}
void exit()
{
int ch;
printf("\nContinue playing ? (1 - Yes and 0 - No) : ");
scanf("%d",&ch);
if(ch==1)
{
start();
}
else
{
printf(“ Try again next time”);
}
}
Page | 22
4.2 ALGORITHM
Step 1 : Start
Step 5 : If user input is Help, the rules for the quiz game will be displayed.
Step 6 : If user input is score, the scores of all the users will be displayed.
Step 8 : If user input is start, the quiz game will start by displaying questions.
Step 9 : User input for the answer for the question displayed.
Step 11: If the answer is wrong, the correct answer would be displayed and score
remains unchanged.
Step 13: Once all the questions are answered, the score of the user will be displayed.
Page | 23
FLOW CHART
Page | 24
5. RESULT
REGISTRATION
MAIN MENU
START
Page | 25
HIGH SCORE
GAME HELP
EXIT
Page | 26
ADVANTAGES
The game designed is user friendly and interactive.
The designed game is highly error and mistake proof as no information has to be entered
manually.
DISADVANTAGES
No time limit for answering each question.
Page | 27
6. CONCLUSION
The software ‘QUIZ’ created is intended to minimize the time required to administer a quiz ,
to measure the points, to shortlist the participant name , and thereby to improve the performance
. It is planned to replace current manual documentation and correction. The introduction of the
method in the enterprise would dramatically minimize time and will also have easily measured
markers.
Page | 28
7. BIBLIOGRAPHY
www.geeksforgeeks.org
www.researchgate.net
www.tutorialspoint.com
Page | 29