1.WHEN COMPUTER WAS FIRST INVENTIONED?
a.1822
b.1823
c.1834
d.1922
a
2.WHO kILLED PRESEDENT BENOGIR VUTTO?
a.nawaz shrif
b.pervase
c.non of them
d.political leder
c
3.WHO IS THE CAPTAIN OF BANGLADESH CRICKET TREAM?
a.asharaful
b.murtaja
c.rafiq
d.aftab
a
4.WHAT IS OUR NATIONAL GAME?
a.cicket
b.football
c.hadodo
d.badminton
c
5.WHO IS NOW CHIEFJUSTICS IN BANGLADESH?
a.yeaz uddin
b.moin
c.jalil
d.fakhar uddin
d
6.WHO IS THE PRIME MINISTER OF INDIA?
a.sonia gundi
b.rajib gundi
How to take This Quiz Contest in CPP
#include<iostream.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include<fstream.h>
class contest
{
private:
int roll;
float x;
char name[20];
char s[100],ans;
public:
contest()
{ x=0; }
void init();
void define();
void display();
};
void contest :: define()
{
ifstream in;
char a;
int i=0;
in.open("ques.txt");
while(in.eof()==0)
{
in.getline(s,100);
cout<<endl<<s;
if(i==5)
{
in.get(a);
cout<<"\nans:";
cin>>ans;
i=-1;
if(ans==a)
{
x=x+5;
cout<<" *Your ans correct.\n";
}
else
{
if(x>0)
x=x-2.5;
cout<<" # Wrong ans.\n";
}
}
i++;
}
in.close();
}
void contest :: init()
{
cout<<"\t\t\t Examinee Name:";
cin>>name;
cout<<"\t\t\t Examinee roll:";
cin>>roll;
}
void contest :: display()
{
cout<<"\n **Result:\n";
cout<<"\t"<<name<<" you got total "<<x<<" marks,out of 50.\n";
}
void main()
{
clrscr();
contest r;
cout<<" \t\t\t~~~*** QUIZ CONTEST ***~~~\t Total Marks:50\n\n";
r.init();
cout<<"\t*5 marks per Ques(half negative marking for wrong ans)";
L:
cout<<"\n\n\tselect your choice:\n"
<<"\n\t1 for start exam"
<<"\n\t0 for quit the exam :";
int c;
cin>>c;
switch(c)
{
case 1:
r.define();
r.display();
break;
case 0:
exit(1);
default:
cout<<"invalid choice!";
goto L;
}
getch();
}
No comments:
Post a Comment