Vous êtes sur la page 1sur 9

First Intro page

Certi from school


Acknowledgement
Contents/index
Abstract
Project profile
System requirement
Hardware requirement
Project Code Explanation
Future enhancement

A project report on

QIUZ
Submitted in partial fulfillment to CBSE boards as a part of HSC
curriculum
By:
JAYDEEP VASANI
Roll No.:30

Acknowledgment

To get the practical knowledge and to make a report on a certain topic


without anybodys help is really a task of great difficulty. Fortunately in
preparation of this report I got the help of many known as well as unknowns
for providing the valuable information about each and every stage of this
project.
I am sincerely thankful our school Sarvodaya educational network for giving
me the opportunity of making this project and thereby having chance to
gather more practical knowledge about my subject computer science.
The success of any project is never limited to the individual undertaking the
project. However, there are some key personalities whose role is very vital in
project. So I greatly obliged to express my gratitude towards Mr. Satyam soni
sir for giving me assistance, guidance, inspiration in this project.
With sincere regards
JAYDEEP VASANI

Abstract
This is a highly flexible quiz project that can be used to test your visitors, with the
accurate results. This project supports arbitrary number of questions, each
supporting an arbitrary number of choices. This quiz program project is based on

C++ programming where the users can check their knowledge by answering the
questions . The results are accurate for the users. This project can be easily
handled by the users. This quiz program is fully designed with C++ programming.
This is a complete quiz portal for quiz masters.

Project profile
Project Name
Developer
Platform
Methodology
Tools

JAYDEEP VASANI
Windows Operating System

Duration

STRUCTURE
Programming language: c++
IDE
: Turbo c++
12th june 2016 to 13nd jan2015

Internal Guide

Satyam sir Kondhiya

Hardware Requirements:
Hardware

Requirements

1) Operating system

1) Windows Xp, 7, or higher.

2) Ram

2) 2 GB ram

3) Hard disk storage space

3) 2 MB

4) Processor

4) Intel Core i3 or higher.

Project Code Explanation


//Here are the header file inserted for the working of keyword and other codes

#include<conio.h>
#include<fstream.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
#include<dos.h>

//here void with write function is for inserting questions


void write_ques_gen(char *);
//here void with read function is for getting question from the file and show on screen
void read_ques_gen(char *);
//here void with calc function calculate the marks of the user who give the quiz
void calc_marks_gen(char *);
struct general
{
int sr_no;
char que[200];
char opt[4][100];
char ans;
}s1,s2,s3;
struct gen_ans
{
char user_ans;
}gs1,gs2;
void main()
{
clrscr();
cout<<"\n\t\t|-----------------------------------------------|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\t\t\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t CLASS XII\t\t\t|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t PROJECT ON QUIZ\t\t|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t MADE BY:- JAYDEEP VASANI\t|";
cout<<"\t\t\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|\t\t\t\t\t\t|";
cout<<"\n\t\t|-----------------------------------------------|";
getch();
char *c;
int choice;
do
{
clrscr();
cout <<
cout <<
cout <<
cout <<
cout <<
cout <<

"\n\n------- Select Subject for Test---------";


"\n1. General";
"\n2. Physics";
"\n3. Chemistry";
"\n4. Maths";
"\n0. Quit";

cout << "\n\nEnter Your Choice: ";


cin >> choice;
switch(choice)
{
case 1:
cout << "\n\n\n\n\n\t\t\t--------Get Ready for Test---------";
getch();
clrscr();
c="GEN.txt";
// cout << "ques on the way";
// write_ques_gen(c);
read_ques_gen(c);
calc_marks_gen(c);
getch();
break;
case 2:
cout << "\n\n\n\n\n\t\t\t--------Get Ready for Test---------";
getch();
clrscr();
c="physics.txt";
// write_ques_gen(c);
read_ques_gen(c);
calc_marks_gen(c);
break;
case 3:
cout << "\n\n\n\n\n\t\t\t--------Get Ready for
Test---------";
getch();
clrscr();
c="chemistry.txt";
read_ques_gen(c);
calc_marks_gen(c);
break;
case 4:
cout << "\n\n\n\n\n\t\t\t--------Get Ready for Test---------";
getch();
clrscr();
c="math.txt";
read_ques_gen(c);
calc_marks_gen(c);
break;
case 0:
exit(0);
default:
cout << "Please Enter Valid Subject Code";
break;
}
}while(choice!=0);
getch();
}
void write_ques_gen(char *c)
{
ofstream fout(c, ios::app|ios::binary);
for(int i=0;i<=9;i++)

{
cout << "Write question";
cout << "\n\nQuestion No.: ";
cin >> s1.sr_no;
cout << "Question: \n";
gets(s1.que);
cout << "Options: \n";
char opt[4] = {'a','b','c','d'} ;
for(int j=0;j<4;j++)
{
//cout << ":" << j+1 << ": ";
cout << ":" << opt[j] << ": " ;
gets(s1.opt[j]);
}
cout << "\nAnswer: ";
cin >> s1.ans;
fout.write((char*)&s1,sizeof(s1));
cout << "\n\n ----- Question Written in file -----";
getch();
clrscr();
}
fout.close();
getch();
}
void read_ques_gen(char *c)
{
ifstream fin(c,ios::in|ios::binary);
ofstream fout2("ans.txt",ios::out|ios::binary);
if(!fin)
{
cout << "Sorry Exam can't be conducted due to technical reason";
getch();
exit(0);
}
//
fin.seekg(0);
int cnt=0;
char opt[4] = {'a','b','c','d'} ;
//fin.read((char*)&s2,sizeof(s2));
while(!fin.eof())
{
fin.read((char*)&s2,sizeof(s2));
cout << endl << s2.sr_no << "> " << s2.que << endl;
for(int j=0;j<=3;j++)
{
cout << "(" << opt[j] << ") " <<s2.opt[j] << "\n";
}
cout << "\n\n Enter ans: ";
//clrscr();
cin >> gs1.user_ans;
fout2.write((char*)&gs1,sizeof(gs1));
cnt++;
getch();
clrscr();

if(cnt==10)
{
break;
}
}
fin.close();
fout2.close();
}
void calc_marks_gen(char *ch)
{
clrscr();
cout << "Wait... Your Result is in process";
for(int k=0;k<5;k++)
{
cout << ".";
sleep(1);
}
ifstream fin1(ch,ios::in|ios::binary);
ifstream fin2("ans.txt",ios::in|ios::binary);
int count=0;
int c=0;
while(!fin1.eof() && !fin2.eof())
{
fin1.read((char*)&s3,sizeof(s3));
fin2.read((char*)&gs2,sizeof(gs2));
if(s3.ans == gs2.user_ans)
{
count++;
}
c++;
if(c==10)
{
break;
}
}
clrscr();
cout << "You Scored: " << count;
getch();
}

FUTURE ENHANCEMENT
PROVIDING NEW UPDATES TO THE QUIZ FILES(SO USER CAN GET MORE NEW THINGS)

Vous aimerez peut-être aussi