1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
void main()
{ char choice;
Quiz q1;
clrscr();
cout<<" * * *";
cout<<" * * * ";
cout<<" * ** ";
cout<<" * * * ";
cout<<" * * *";
cout<<"\n\n\n Welcome to INFINITE KNOWLEDGE, the most interactive DOS-based quiz";
cout<<"\n ever. This will surely sharpen your skills on the topics which you select.";
cout<<"\n\n So, go ahead and reach your milestone!";
cout<<"\n\n\n\n\n Press 'A' for About, 'L' for Legal, 'H' for Help, 'HS' for Highest Scores and 'S' to Start:";
cin>>choice;
if ((choice=='A')||(choice=='a'))
{ clrscr();
q1.about();
}
else if((choice=='L')||(choice=='l'))
{ clrscr();
q1.legal();
}
else if((choice=='H')||(choice=='h'))
{ clrscr();
q1.help();
}
else if((choice=='S')||(choice=='s'))
{ clrscr();
q1.start();}
else
{ cout<<"\n Wrong choice...EXITING!!";
exit(0);
}
}
void Quiz::about()
{ char ch1;
cout<<" * * * * * * * * * * * * * *";
cout<<" * * * * * * * * * ";
cout<<" * * * * * * * * * * * ";
cout<<" * * * * * * * * * ";
cout<<" * * * * * * * * * * * * ";
cout<<"\n\n\n INFINITE KNOWLEDGE is an interactive application quiz based on the recent";
cout<<"\n affairs, history of world, sceinces, computers, english and much more.";
cout<<"\n Developed to test how much you know of your selection, this'll be a great help";
cout<<"\n for all in future.";
cout<<"\n See the interrorgation, analyse it and if you're sure then only move ahead";
cout<<"\n or if you fail for an answer don't worry, we'll provide you. And yes, there are explanations also!";
cout<<"\n\n\n\n\n Press 'L' for Legal, 'H' for Help, 'HS' for Highest Scores and 'S' to Start:";
cin>>ch1;
if((ch1=='L')||(ch1=='l'))
{ clrscr();
legal();
}
if((ch1=='H')||(ch1=='h'))
{ clrscr();
help();
}
else if((ch1=='S')||(ch1=='s'))
{ clrscr();
start();
}
else
{ cout<<"n Wrong choice...EXITING!!";
exit(0);
}
system ("pause");
}
void Quiz::legal()
{ char ch2;
cout<<" * * * * * * * * * * * ";
cout<<" * * * * * * ";
cout<<" * * * * * * * * * * ";
cout<<" * * * * * * * ";
cout<<" * * * * * * * * * * * * * * ";
cout<<"\n\n\n Developed by : VAIBHAV KHULBE with ROHAN SHARMA";
cout<<"\n\n Roll No(s) : 12140 and 1213 ";
cout<<"\n\n Class and Section : XII - A";
cout<<"\n\n Last modified on : / / 14";
cout<<"\n\n Questions taken from : 'INFINITE KNOWLEDGE - A Quiz Book' by VAIBHAV KHULBE and PRATEEK LIDHOO";
cout<<"\n\n (c) 2014 Developers and Authors";
cout<<"\n\n Press 'A' for About, 'H' for Help, 'HS' for Highest Scores and 'S' to Start:";
cin>>ch2;
if((ch2=='A')||(ch2=='a'))
{ clrscr();
about();
}
else if((ch2=='H')||(ch2=='h'))
{ clrscr();
help();
}
else if((ch2=='S')||(ch2=='s'))
{ clrscr();
start();
}
else if((ch2=='HS')||(ch2=='hs'))
{ clrscr();
// highScore();
}
else
{ cout<<"n Wrong choice...EXITING!!";
exit(0);
}
}
void Quiz::help()
{ char ch3;
clrscr();
cout<<" * * * * * * * * * ";
cout<<" * * * * * * ";
cout<<" * * * * * * * * * ";
cout<<" * * * * * ";
cout<<" * * * * * * * * * ";
cout<<"\n\n\n We believe there isn't any need of HELP for you.";
cout<<"\n This is the most simlplest quiz made intuitively for everyone.";
cout<<"\n We'll provide you with extra hints as you give us the answers.";
cout<<"\n For that all you need to do is to choose an option from the four alternatives : 'a', 'b', 'c' or 'd'!";
cout<<"\n\n\n GO AHEAD!";
cout<<"\n\n\n Press 'A' for About, 'L' for Legal, 'HS' for Highest Scores and 'S' to Start:";
cin>>ch3;
if((ch3=='A')||(ch3=='a'))
{ clrscr();
about();
}
else if((ch3=='S')||(ch3=='s'))
{ clrscr();
start();
}
else if((ch3=='HS')||(ch3=='hs'))
{ clrscr();
// highScore();
}
else if((ch3=='L')||(ch3=='l'))
{ clrscr();
legal();
}
else
{ cout<<"n Wrong choice...EXITING!!";
exit(0);
}
}
void Quiz::start()
{ char lchoice, tchoice;
clrscr();
cout<<"\n How should we call you? :";
cin>>userName;
cout<<"\n"<<userName<<" choose a Level : Beginner \t Intermediate \t Expert";
cout<<"\n Press 'B' for Beginner, 'I' for Intermediate or 'E' for Expert:";
cin>>lchoice;
{ if((lchoice=='B')||(lchoice=='b'))
clrscr();
{ cout<<userName<<" In which of the following topics you're interested in?";
cout<<"\n 'S'ciences, 'A'rts, 'E'ntertainment, 'G'eography, 'I'ndia, 'L'anguage and Literature or 'S'ports";
cout<<"\n Enter the letter inside the inverted commas of your selection:";
cin>>tchoice;
if((tchoice=='S')||(tchoice=='s'))
{ clrscr();
bScience();}
}
}
}
void Quiz::bScience()
{ clrscr();
char userAns, ch[50];
cout<<"\n\n\n\n You're interested in 'Sciences'";
cout<<"\n and you think you're a 'Beginner'";
cout<<"\n So, let's start...";
clrscr();
ifstream f1;
f1.open("bScQues.txt");
while (!f1.eof())
{f1.getline(ch, 50, '\n');
cout<<ch;}
cout<<"\n\n What's your answer?:";
cin>>userAns;
}
|