
-----------------------------------
varundesi
Thu Nov 02, 2006 8:21 pm

random  string line
-----------------------------------
I need to create a program that creates and administers a true/false quiz. Questions are read from a data file into one array and a related array is used to store the answers, either T or F, for each question. When the user takes the test, questions are presented in random order, without repetition. Keep track of the number of questions answered and the number of correct answers. When the user has finished the quiz, display the mark as a percentage.

I m sorry but thats all i have, plz help me out

#include 
#include 
#include 
using namespace std;

int main()
{
	char cAns;
	ifstream fin;
	string sLine;
	fin.open("72bIN.txt");
	while(!fin.fail())
	{
	getline (fin,sLine);
	if(fin.eof())
			break;
	cout>ans;  
cin.ignore();  //ignores the endline character after the answer

so you may have a vector questions
add: questions.push_back(make_pair(question, ans=='T'))
to store all your quizzes...
to randomly shuffle it:
random_shuffle(questions.begin(),questions.end())
