quiz!!

I have complied this code, it is suposed to work as an english quiz and my friend is compling the quiz bank. it generates random questions and 15seconds to answer the question, but it isnt working properly

#include <iostream>

#include <cstdlib>

#include <ctime>

#include <string>

#include <fstream>

#include <iomanip>





using namespace std;





English Quiz


{


public:


int question(int);


int showQuestion(int, int, int, char);


void exit();


};

int leanne’s quiz::show questions(int operand1, int operand2, int answer, char operatorA)


{

questionid = cast(rand() * n as int)
// Where N is any number


char user_input;


time_t delay;


// Prints out the question


cout << "\n\n\t\t\t" << operand1 << " " << operand2 << " = " << answer << "\n";


// Start time is recorded


time_t start = time(NULL);


cin >> user_input;


delay = time(NULL)-start;

if(delay > 15)


{


cout <<"\n\n\t\t\tYou Took too long this time!! (" << delay << " seconds.)";


return(0);


}


//If they answer within 15seconds


if(operatorA == user_input)


{


cout<<"\n\n\t\t\tCorrect";


return(1);


}


else


{


cout <<"\n\n\t\t\tNot so smart this time  ";


return(0);


}


}

}

void Quiz::exit ()


{

int main(void)

{

int i, num, score;
srand((unsigned)time(0));
Quiz quiz;
cout << "\tThis is the English Quiz \n";
cout << "\t5Points for each correct answer \n";
cout << "\tOnly 15sec to answer correct!!! \n";
cout <<"\tGood Luck!!!\n\n\n";
score=0;
for (i=0;i<=9;i++)

{
questionid = cast(rand() * n as int)

if(quiz.question(num)==1){score++;}

}
return 0;
}

Please edit your post and put the code in the proper [code] tags.
And read: http://www.cplusplus.com/forum/articles/1295/
Topic archived. No new replies allowed.