randoming question

hello guys can i ask ? i have a problem with my program and i need to random question when i choose "PART" here is my code :

#include <iostream>
#include <iomanip>
#include <conio.h>
#include <string>
#include <cstdlib>
#include <ctime>

using namespace std;

int main()
{

int score = 0,score1 = 0,score2 = 0,score3 = 0;
string name;
char answer,ans;
int select,total;
char a,b,c,d;


cout<<"================================================================================\n"
<<"| PLEASE CHOOSE : |\n"
<<"| |\n"
<<"| 1.)Part I ( 1 - 10 ) |\n"
<<"| |\n"
<<"| 2.)Part II ( 11 - 20) |\n"
<<"| |\n"
<<"| 3.)Part III( 21 - 30) |\n"
<<"| |\n"
<<"| 4.)Part IV ( 31 - 40) |\n"
<<"| |\n"
<<"| 5.)Exit The Program |\n"
<<"==============================================================================="<<endl;

cout<<"Enter Chapter: ";
cin>>select;

switch (select)
{

case 1:
cout<<"*************"
<<"* Chapter I *"
<<"*************"<<endl;

cout<<"Question #1: The process of fixing some errors in the program is called ? "<<endl;
cout<<" A)Bug"<<endl;
cout<<" B)Debugging"<<endl;
cout<<" C)Coding"<<endl;
cout<<" D)Decoding"<<endl;
cout<<"Enter Your Answer: ";
cin>>answer;
if(answer == 'b' || answer == 'B')
score++;

cout<<"Question #2: Errors in the program are called? "<<endl;
cout<<" A)Bag"<<endl;
cout<<" B)Bug"<<endl;
cout<<" C)Beg"<<endl;
cout<<" D)Baug"<<endl;
cout<<"Enter Your Answer: ";
cin>>answer;
if(answer == 'b' || answer == 'B')
score ++;

cout<<"Question #3: String will always enclosed with "<<endl;
cout<<" A)' '"<<endl;
cout<<" B)| |"<<endl;
cout<<" C)" ""<<endl;
cout<<" D);"<<endl;
cout<<"Enter Your Answer: ";
cin>>answer;
if(answer == 'c' || answer == 'C')
score++;
}


cin.get();
cin.get();
return 0;
}

please help me ASAP :) Advance thank you guys !
Last edited on
"errors" and "bugs" are two completely different and unrelated things ;)

Try reading up on random number generators in C++:
http://en.cppreference.com/w/cpp/header/random
http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
Last edited on
can you fix my program sir ? im sorry to bother you but i need that program tomorrow :( !
Topic archived. No new replies allowed.